标题是不言自明的。我只是下载了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 --版本输出:
Google Cloud SDK 319.0.0
bq 2.0.62
cloud-build-local
core 2020.11.13
gsutil 4.55
最佳答案
tl;博士; 权限
我按照 IAM 仪表板中的建议从我的默认应用引擎服务帐户中删除了编辑者权限。
在文档(我能找到的)中没有任何地方告诉您部署应用程序引擎灵活服务需要哪些权限。
事实证明,您需要:
Logs Writer
Storage Object Viewer
如果没有存储对象查看器,您将在部署时收到一条错误消息,告诉您确切的问题。如果没有日志编写器,您将不会收到错误,但该服务永远不会启动。
多么漫长的10天......
编辑:我错了,它说here in the docs您需要什么权限。
我要求 Google 支持人员提交一个内部错误,即如果您没有日志写入器,则不会返回正确的错误消息
关于gcloud app 部署灵活环境挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64921273/