首页 > 解决方案 > gcloud app deploy 灵活环境挂起

问题描述

标题是不言自明的。我只是下载了flexible-hello-world应用程序并在没有(几乎)一次修改的情况下部署它 - 我将它部署到some-service使用这个 app.yaml调用的服务中

# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex
service: some-service

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

# [END gae_flex_quickstart_yaml]

我为我的项目启用了计费帐户。

它挂在这一行:

...
7104cb4c0c814fa53787009 size: 2385
Finished Step #1
PUSH
DONE
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Updating service [some-service] (this may take several minutes)...⠹    

当我转到应用引擎控制台时,我看到它已部署并且可以在此处访问 URL:https ://some-service-dot-ashored-cloud-dv.uk.r.appspot.com/

但 502 永远不会消失。

帮助!

编辑:

更多信息,虽然它仍然挂在部署命令上,但我在另一个终端中运行它:

gcloud app instances list --service some-service

我得到:

SERVICE       VERSION          ID                                      VM_STATUS   DEBUG_MODE
some-service  20201119t184828  aef-some--service-20201119t184828-fr7n  TERMINATED

编辑2:

当我尝试 ssh 到它时,我会变得更加奇怪:

gcloud app instances ssh aef-some--service-20201119t184828-fr7n --service some-service --version 20201119t184828

WARNING: This instance is serving live application traffic.  Any changes made could
result in downtime or unintended consequences.
Do you want to continue (Y/n)?  

Sending public key to instance [apps/ashored-cloud-dv/services/some-service/versions/20201119t184828/instances/aef-some--service-20201119t184828-fr7n].
Waiting for operation [apps/ashored-cloud-dv/operations/9de7b298-f4e9-47a7-8a8e-11411e649d50] to complete...done.                                            
ERROR: gcloud crashed (TypeError): can only concatenate str (not "NoneType") to str

编辑2:

glcloud --version 输出:

Google Cloud SDK 319.0.0
bq 2.0.62
cloud-build-local 
core 2020.11.13
gsutil 4.55

标签: gcloudapp-engine-flexible

解决方案


tl;博士; 权限

我按照 IAM 仪表板中的建议从我的默认应用引擎服务帐户中删除了编辑权限。

在文档中(我可以找到)中没有任何地方告诉您部署应用引擎灵活服务需要哪些权限。

事实证明,你需要:

Logs Writer
Storage Object Viewer

如果没有存储对象查看器,您将在部署时收到一条错误消息,告诉您确切的问题。如果没有Logs Writer,您将不会收到错误,但该服务将永远不会出现。

多么漫长的10天……

编辑:我错了,它在文档中说你需要什么权限。

我要求 Google 支持提交一个内部错误,即如果您没有 Logs Writer,则不会返回正确的错误消息


推荐阅读