错误:(gcloud.app.deploy)INVALID_ARGUMENT:无法解析源
Posted
技术标签:
【中文标题】错误:(gcloud.app.deploy)INVALID_ARGUMENT:无法解析源【英文标题】:ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source 【发布时间】:2019-09-24 07:17:46 【问题描述】:我正在尝试部署一个以前可以工作的 go 1.11
运行时,但最近我收到了:ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source
错误。
我的app.yaml
中的任何内容都没有改变,错误消息对于理解问题可能没有帮助。我用--verbosity=debug flag
运行它并得到:
Building and pushing image for service [apiv1]
DEBUG: Could not call git with args ('config', '--get-regexp', 'remote\\.(.*)\\.url'): Command '['git', 'config', '--get-regexp', 'remote\\.(.*)\\.url']' returned non-zero exit status 1
INFO: Could not generate [source-context.json]: Could not list remote URLs from source directory: /var/folders/18/k3w6w7f169xg4mypdwj7p4_c0000gn/T/tmp6IkZKx/tmphibUAo
Stackdriver Debugger may not be configured or enabled on this application. See https://cloud.google.com/debugger/ for more information.
INFO: Uploading [/var/folders/18/k3w6w7f169xg4mypdwj7p4_c0000gn/T/tmpVHKXol/src.tgz] to [staging.wildfire-app-backend.appspot.com/asia.gcr.io/wildfire-app-backend/appengine/apiv1.20190506t090359:latest]
DEBUG: Using runtime builder root [gs://runtime-builders/]
DEBUG: Loading runtimes manifest from [gs://runtime-builders/runtimes.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x105ca9b10>]
DEBUG: Resolved runtime [go1.11] as build configuration [gs://runtime-builders/go-1.11-builder-20181217154124.yaml]
INFO: Using runtime builder [gs://runtime-builders/go-1.11-builder-20181217154124.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x105b03b50>]
DEBUG: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source
Traceback (most recent call last):
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 985, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 795, in Run
resources = command_instance.Run(args)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/app/deploy.py", line 90, in Run
parallel_build=False)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 636, in RunDeploy
flex_image_build_option=flex_image_build_option)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 411, in Deploy
image, code_bucket_ref, gcr_domain, flex_image_build_option)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 287, in _PossiblyBuildAndPush
self.deploy_options.parallel_build)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/deploy_command_util.py", line 450, in BuildAndPushDockerImage
return _SubmitBuild(build, image, project, parallel_build)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/deploy_command_util.py", line 483, in _SubmitBuild
build, project=project)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/api_lib/cloudbuild/build.py", line 149, in ExecuteCloudBuild
build_op = self.ExecuteCloudBuildAsync(build, project)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/api_lib/cloudbuild/build.py", line 133, in ExecuteCloudBuildAsync
build=build,))
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/googlecloudsdk/third_party/apis/cloudbuild/v1/cloudbuild_v1_client.py", line 205, in Create
config, request, global_params=global_params)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/third_party/apitools/base/py/base_api.py", line 731, in _RunMethod
return self.ProcessHttpResponse(method_config, http_response, request)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/third_party/apitools/base/py/base_api.py", line 737, in ProcessHttpResponse
self.__ProcessHttpResponse(method_config, http_response, request))
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/third_party/apitools/base/py/base_api.py", line 604, in __ProcessHttpResponse
http_response, method_config=method_config, request=request)
HttpBadRequestError: HttpError accessing <https://cloudbuild.googleapis.com/v1/projects/wildfire-app-backend/builds?alt=json>: response: <'status': '400', 'content-length': '114', 'x-xss-protection': '0'
, 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-encoding': 'gzip', 'cache-control': 'private', 'date': 'Mon, 06 May 2
019 16:04:41 GMT', 'x-frame-options': 'SAMEORIGIN', 'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"', 'content-type': 'application/json; charset=UTF-8'>, content <
"error":
"code": 400,
"message": "unable to resolve source",
"status": "INVALID_ARGUMENT"
>
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve
任何建议都会很有用,我也用gcloud beta
尝试过,我轮换了我的凭据,但没有用。我的用户有Owner
角色,但我单独添加了所有可能需要的角色
App Engine Admin
App Engine Code Viewer
App Engine Deployer
App Engine Service Admin
Project Billing Manager
Cloud Build Service Account
Cloud Build Editor
Cloud Build Viewer
Owner
Storage Admin
【问题讨论】:
我在几周前尝试在 GAE 上部署时遇到了这个错误。我在网上找不到任何真正的解决方案,最后当我稍后重试时它才起作用。由于 Gogole 方面的问题似乎更多,因此可能值得在他们的公共问题跟踪器上提出问题:issuetracker.google.com/issues?q=star:true @DuckHuntDuo 它已经发生了大约一个星期,但我会尝试公共问题跟踪器。谢谢! 【参考方案1】:尝试在您的项目中禁用和启用 Cloud Build API,以便创建一个新的服务帐号,然后再次尝试部署。
这可确保 Cloud Build 有权启动构建(服务帐号名称应类似于 project-number@cloudbuild.gserviceaccount.com)。
【讨论】:
将角色“App Engine Deployer”添加到 canbuild 服务帐户为我做了这件事【参考方案2】:Cloud Build 使用服务帐号而不是您的用户凭据,因此在这种情况下,向您的用户添加角色将无济于事。
您应该能够手动将服务帐户 [project-number]@cloudbuild.gserviceaccount.com 添加回您的帐户,而无需重新启用 API。众所周知,有些用户会删除他们不认识的随机服务帐户,这有时会导致此问题。
总而言之,检查服务帐户是否存在。如果是这样,给它它需要的所有角色;如果没有,则创建它并赋予它所需的所有角色。
【讨论】:
【参考方案3】:我发现 API 权限完全传播需要一段时间。
我在启用 App Engine Admin API 后遇到了这个错误,但我等了几分钟再试一次,它工作正常。
【讨论】:
这里也一样。我的花了 10~ 分钟。以上是关于错误:(gcloud.app.deploy)INVALID_ARGUMENT:无法解析源的主要内容,如果未能解决你的问题,请参考以下文章
错误:(gcloud.app.deploy)错误响应:[9] Cloud build XXXXXXXXXXXX 状态:FAILURE
(gcloud.app.deploy) 错误响应:[7] 未配置访问。项目中未使用 Cloud Build
错误:(gcloud.app.deploy)您必须在使用自定义运行时提供自己的 Dockerfile
错误:(gcloud.app.deploy)错误响应:[9] Flex 操作项目/.../regions/us-central1/operations/...错误 [FAILED_PRECONDITI
在 Google App Engine 上部署 Django ==> 错误:(gcloud.app.deploy)NOT_FOUND:无法检索 P4SA(...)