GCP 在上传“debug-server”服务(模块)的版本之前更改应用引擎的“默认”服务(模块)

GCP change App engine 'default' service (module) before uploading a version for the 'debug-server' service (module)

提问人:KicksTerz 提问时间:10/23/2023 最后编辑:KicksTerz 更新时间:10/24/2023 访问量:56

问:

我正在使用 Ap 引擎设置服务器端标记。我按照此处的官方文档按照步骤操作 https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup 因此,我的 GCP 项目和我的 App 引擎都已创建。

然后,我按照以下 shell 脚本创建我的标记服务器bash -c "$(curl -fsSL https://googletagmanager.com/static/serverjs/setup.sh)"

但是在我完成所有提示后,我收到以下错误消息: 错误:(gcloud.app.deploy) INVALID_ARGUMENT:上传到新应用程序的第一个服务(模块)必须是“默认”服务(模块)。在上传“debug-server”服务(模块)的版本之前,请先上传“默认”服务(模块)的版本。

如何上传第一个“默认版本”? 任何帮助将不胜感激。

以下是所有配置:

Your configured settings are
Container Config: aWQ9R1RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXdw==
Policy Script URL: ''
Request Logging: off
Deployment Type: production
Autoscaling: on
Minimum Number of Servers: 3
Maximum Number of Servers: 6
CPU Target Utilization: 0.6
Do you wish to continue? (y/N): y
As you wish.
Services to deploy:

descriptor:                  [/tmp/tmp.wtPjxgoyOe/debug.yaml]
As you wish.
Services to deploy:

descriptor:                  [/tmp/tmp.wtPjxgoyOe/debug.yaml]
source:                      [/tmp/tmp.wtPjxgoyOe]
target project:              [lXXXXXXX-web]
target service:              [debug-server]
target version:              [production]
target url:                  [https://debug-server-dot-XXXXXXX-web.lm.r.appspot.com]
target service account:      [[email protected]]


Beginning deployment of service [debug-server]...
Created .gcloudignore file. See `gcloud topic gcloudignore` for details.
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 0 files to Google Cloud Storage                ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The first service (module) you upload to a new application must be the 'default' service (module). Please upload a version of the 'default' service (module) before uploading a version for the 'debug-server' service (module). See the documentation for more information. Python: (https://developers.google.com/appengine/docs/python/modules/#Python_Uploading%%20modules) Java: (https://developers.google.com/appengine/docs/java/modules/#Java_Uploading%%20modules)

我尝试使用 Google Cloud App Engine 创建标记服务器。但是由于所述错误,创建过程未完成。

google-app-engine 谷歌标签管理器服务器端

评论


答:

0赞 NoCommandLine 10/24/2023 #1
  1. 每个 Google App Engine 应用都需要有一个“默认”服务。这是当有人运行您的应用程序/加载网站时加载的应用程序。

  2. 除了默认服务之外,您还可以使用其他服务(本质上是同一项目下的不同应用程序)可以执行其他操作。

  3. 从您的评论中可以看出,您为设置标记服务器而运行的脚本似乎为您的服务提供了 的名称 。要解决您的问题,至少有 2 个选项debug-server

    a) 修改脚本并删除服务名称(当没有服务名称时,gcloud 会将其视为服务)。您也可以将名称更改为defaultdefault

    b) 将基本的 hello world 应用部署为默认服务。您可以使用 Google App Engine 的示例应用程序之一。以下是 PythonNodeJS、PHP 的链接