【问题标题】:gcloud app deploy flexible environment hangsgcloud app deploy 灵活环境挂起
【发布时间】:2020-11-19 22:56:31
【问题描述】:

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

# 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

【问题讨论】:

  • 挂起是指CLI上更新服务结束时的符号停止滚动吗?通常是 App Engine Flex 应用程序take time to deploy(我尝试了您提供的快速入门,我花了大约 8 分钟)。你能提供你的SDK版本吗?检查您的日志也有帮助
  • @DonnaldCucharo 用版本输出更新了答案,这就是 --verbosity debug 不断提出的问题:Updating service [some-service] (this may take several minutes)...⠧DEBUG: Operation [apps/ashored-cloud-dv/operations/a2022048-9e4e-44d8-a9c0-a1e2cd8fcd56] not complete. Waiting to retry.
  • @DonnaldCucharo - 我完全迷路了。现在,每当我在应用引擎仪表板中为我的新服务点击谷歌提供的 apppot URL 时,它最终都会将该流量引导到我的默认服务。我完全不清楚为什么。
  • 如果您仍然遇到该问题,建议您联系 Google Cloud 支持,以便他们了解您的项目的进展情况。
  • 啊,好的。 FWIW,gcloud“TypeError”是一个在 gcloud 320.0.0 中修复的错误。当启动操作超时并且没有主机名返回给 gcloud 以使其通过 SSH 访问时,就会发生这种情况。

标签: gcloud app-engine-flexible


【解决方案1】:

tl;博士; 权限

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

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

事实证明,你需要:

Logs Writer
Storage Object Viewer

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

多么漫长的 10 天……

编辑:我错了,上面写着here in the docs你需要什么权限。

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

【讨论】:

    猜你喜欢
    • 2020-09-03
    • 1970-01-01
    • 1970-01-01
    • 2020-07-07
    • 2020-11-23
    • 2017-06-04
    • 2017-01-09
    • 1970-01-01
    • 2017-11-16
    相关资源
    最近更新 更多