gcloud preview app deploy returns 400 消息应用引擎服务帐户对项目没有足够的权限。需要开发商或业主
gcloud preview app deploy returns 400 with message App engine service account has insufficient permissions for project. Developer or owner required
我正在尝试将 node.js 应用程序部署到 google 云平台,因此我采用了以下方法:
假设我的项目ID:"logger"(#445533661888)
1) 我按照此文档 link 部署应用程序,link : https://cloud.google.com/nodejs/resources/frameworks/express
2) 项目 app.yaml 包括:
runtime: nodejs
vm: true
service: default
skip_files:
- ^(.*/)?.*/node_modules/.*$
3) 现在转到 google 云控制台 --> IAM & Admin 菜单,在这里我可以看到 logger@appspot.gserviceaccount.com 条目,我还添加了所有者对 myemail@[= 的权限45=] 到此服务帐户
4) 现在使用命令 gcloud auth login 进行身份验证并使用 myemail@gmail.com 完成身份验证
4) 现在我使用 gcloud preview app deploy 开始部署,在这个请求的响应中我得到 Bad Request error 400 和 Message作为
App engine service account has insufficient permissions for project. Developer or owner required
我正在展示堆栈跟踪:
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.
我找到了解决方案,实际上我在想 myemail@gmail.com 应该是项目的所有者。
但是我没太注意他们的话 "App engine service account has insufficient permissions for project. Developer or owner required"
步骤:
- 转到开发人员控制台中列出的服务帐户
- select"your-project-id@appspot.gserviceaccount.com",点击权限。
- 将 your-project-id@appspot.gserviceaccount.com 添加到新成员并将角色分配为所有者。
它解决了问题
我正在尝试将 node.js 应用程序部署到 google 云平台,因此我采用了以下方法:
假设我的项目ID:"logger"(#445533661888)
1) 我按照此文档 link 部署应用程序,link : https://cloud.google.com/nodejs/resources/frameworks/express
2) 项目 app.yaml 包括:
runtime: nodejs
vm: true
service: default
skip_files:
- ^(.*/)?.*/node_modules/.*$
3) 现在转到 google 云控制台 --> IAM & Admin 菜单,在这里我可以看到 logger@appspot.gserviceaccount.com 条目,我还添加了所有者对 myemail@[= 的权限45=] 到此服务帐户
4) 现在使用命令 gcloud auth login 进行身份验证并使用 myemail@gmail.com 完成身份验证
4) 现在我使用 gcloud preview app deploy 开始部署,在这个请求的响应中我得到 Bad Request error 400 和 Message作为
App engine service account has insufficient permissions for project. Developer or owner required
我正在展示堆栈跟踪:
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.
我找到了解决方案,实际上我在想 myemail@gmail.com 应该是项目的所有者。
但是我没太注意他们的话 "App engine service account has insufficient permissions for project. Developer or owner required"
步骤:
- 转到开发人员控制台中列出的服务帐户
- select"your-project-id@appspot.gserviceaccount.com",点击权限。
- 将 your-project-id@appspot.gserviceaccount.com 添加到新成员并将角色分配为所有者。
它解决了问题