gpt4 book ai didi

node.js - gcloud Preview 应用程序部署返回 400,并显示消息 App Engine 服务帐户对项目的权限不足。需要开发商或业主

转载 作者:太空宇宙 更新时间:2023-11-03 22:31:00 25 4
gpt4 key购买 nike

我正在尝试将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 & Admin 菜单,在这里我可以看到 logger@appspot.gserviceaccount.com 条目,此外我已将 myemail@gmail.com 所有者的权限添加到此服务帐户

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

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

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服务帐户没有足够的项目权限。需要开发者或所有者”

步骤:

  1. 转到开发者控制台中列出的服务帐户
  2. 选择“your-project-id@appspot.gserviceaccount.com”,点击“权限”。
  3. 将 your-project-id@appspot.gserviceaccount.com 添加为新成员,并将角色分配为所有者。

解决问题

关于node.js - gcloud Preview 应用程序部署返回 400,并显示消息 App Engine 服务帐户对项目的权限不足。需要开发商或业主,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37160457/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com