gcloud预览应用程序部署返回400消息App引擎服务帐户对项目的权限不足。需要开发者或所有者

时间:2016-05-11 10:52:04

标签: node.js google-app-engine gcloud

我正在尝试将node.js应用程序部署到谷歌云平台,所以我采取了以下方法:

假设项目ID :“logger”(#445533661888)

1)我按照此文档链接部署应用程序,链接:https://cloud.google.com/nodejs/resources/frameworks/express

2)项目 app.yaml 包括:

runtime: nodejs
vm: true
service: default
skip_files:
  - ^(.*/)?.*/node_modules/.*$

3)现在去谷歌云控制台 - > IAM&管理菜单,在这里我可以看到logger@appspot.gserviceaccount.com条目,我也已经将所有者的权限添加到myemail@gmail.com到此服务帐户

4)现在使用命令 gcloud auth login 进行身份验证并使用myemail@gmail.com完成身份验证

4)现在我使用 gcloud预览应用程序部署来开始部署,在此请求的响应中,我得到错误请求错误400 和消息为

  

App引擎服务帐户对项目的权限不足。需要开发人员或所有者

我正在展示堆栈跟踪:

C:\Users\Maulikwin8>gcloud config list
Your active configuration is: [default]

[app]
suppress_change_warning = true
[core]
account = myemail@gmail.com
disable_usage_reporting = False
project = logger

C:\Users\Maulikwin8>cd C:\Users\Maulikwin8\Documents\swan\rnd\node-express-js\nodejs-docs-samples-master\appengine\express

C:\Users\Maulikwin8\Documents\swan\rnd\node-express-js\nodejs-docs-samples-master\appengine\express>gcloud preview app deploy --verbosity=debug
DEBUG: Running gcloud.preview.app.deploy with Namespace(__calliope_internal_deepest_parser=ArgumentParser(prog='gcloud.preview.app.deploy', usage=None, description="*(BETA)* This command is used to deploy both code and configuration to the
App Engine\nserver.  As an input it takes one or more ``DEPLOYABLES'' that should be\nuploaded.  A ``DEPLOYABLE'' can be a service's .yaml file or a configuration's\n.yaml file.", version=None, formatter_class=<class 'argparse.HelpFormatter
'>, conflict_handler='error', add_help=False), account=None, authority_selector=None, authorization_token_file=None, bucket=None, cmd_func=<bound method Command.Run of <googlecloudsdk.calliope.backend.Command object at 0x03078550>>, command
_path=['gcloud', 'preview', 'app', 'deploy'], configuration=None, credential_file_override=None, deployables=[], docker_build=None, document=None, force=False, format=None, h=None, help=None, http_timeout=None, ignore_bad_certs=False, image
_url=None, log_http=None, project=None, promote=None, quiet=None, repo_info_file=None, server=None, stop_previous_version=None, trace_email=None, trace_log=None, trace_token=None, user_output_enabled=None, verbosity='debug', version=None).
INFO: Refreshing access_token
DEBUG: API endpoint: [https://appengine.googleapis.com/], API version: [v1beta4]
You are about to deploy the following services:
 - logger/deployment (from [C:\Users\Maulikwin8\Documents\swan\rnd\node-express-js\nodejs-docs-samples-master\appengine\express\app.yaml])
     Deployed URL: [https://deployment-dot-logger.appspot.com]

Do you want to continue (Y/n)?  Y

Beginning deployment...
DEBUG: No bucket specified, retrieving default bucket.
DEBUG: Using bucket [<googlecloudsdk.api_lib.app.cloud_storage.BucketReference object at 0x03E7A7B0>].
DEBUG: Host: appengine.google.com
DEBUG: _Authenticate configuring auth; needs_auth=False
DEBUG: Sending request to https://appengine.google.com/api/vms/prepare?app_id=logger headers={'X-appcfg-api-version': '1', 'content-length': '0', 'Content-Type': 'application/octet-stream'} body=
INFO: Attempting refresh to obtain initial access_token
INFO: Refreshing access_token
DEBUG: Got http error 400.
DEBUG: Unexpected results: {'status': '400', 'alternate-protocol': '443:quic', 'content-length': '162', 'expires': 'Mon, 01 Jan 1990 00:00:00 GMT', 'server': 'Google Frontend', 'cache-control': 'no-cache', 'date': 'Wed, 11 May 2016 10:44:32
 GMT', 'alt-svc': 'quic=":443"; ma=2592000; v="33,32,31,30,29,28,27,26,25"', 'content-type': 'text/plain'}
WARNING: If this is your first deployment, please try again.
DEBUG: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400.
  Failed Project Preparation (app_id='s~logger'). App Engine service account has insufficient permissions for project. Developer or owner required.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 647, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 1407, in Run
    resources = command_instance.Run(args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\preview\app\deploy.py", line 482, in Run
    deploy_command_util.DoPrepareManagedVms(clients.gae)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 260, in DoPrepareManagedVms
    gae_client.PrepareVmRuntime()
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\appengine_client.py", line 207, in PrepareVmRuntime
    rpcserver.Send('/api/vms/prepare', app_id=self.project)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\util.py", line 365, in Send
    response = self._server.Send(*args, **kwargs)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\third_party\appengine\tools\appengine_rpc_httplib2.py", line 298, in Send
    'Unexpected HTTP status %s' % status)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\third_party\appengine\tools\appengine_rpc_httplib2.py", line 82, in RaiseHttpError
    raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
RPCError: Server responded with code [400]:
  Bad Request Unexpected HTTP status 400.
  Failed Project Preparation (app_id='s~logger'). App Engine service account has insufficient permissions for project. Developer or owner required.
ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400.
  Failed Project Preparation (app_id='s~logger'). App Engine service account has insufficient permissions for project. Developer or owner required.

1 个答案:

答案 0 :(得分:0)

我得到了解决方案,实际上我认为myemail@gmail.com应该是项目的所有者。

但是我没有太注意他们的单词&#34; App引擎服务帐户对项目的权限不足。需要开发人员或所有者&#34;

步骤:

  1. 转到开发者控制台中列出的服务帐户
  2. 选择&#34; your-project-id@appspot.gserviceaccount.com" ;,点击权限。
  3. 将your-project-id@appspot.gserviceaccount.com添加到新成员并指定角色作为所有者。
  4. 它解决了问题