我正在使用 Ap 引擎设置服务器端标记。我按照官方文档的步骤进行操作 https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup 这样我的 GCP 项目就创建好了,我的应用程序引擎也是如此。
然后我按照这个 shell 脚本创建我的标记服务器
bash -c "$(curl -fsSL https://googletagmanager.com/static/serverjs/setup.sh)"
但是当我完成所有提示后,我收到以下错误消息: 错误:(gcloud.app.deploy)INVALID_ARGUMENT:您上传到新应用程序的第一个服务(模块)必须是“默认”服务(模块)。请先上传“默认”服务(模块)的版本,然后再上传“调试服务器”服务(模块)的版本。
如何上传第一个“默认版本”? 任何帮助将不胜感激。
这是所有配置:
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云应用程序引擎创建一个标记服务器。但由于所述错误,创建过程未完成。
每个 Google App Engine 应用程序都需要有一个 “默认”服务。这是当有人运行您的应用程序/加载网站时加载的应用程序。
除了默认服务之外,您还可以拥有其他可以执行其他操作的服务(本质上是同一项目下的不同应用程序)。
从您的评论来看,您运行的用于设置标记服务器的脚本似乎为您的服务提供了名称
debug-server
。要解决您的问题,至少有 2 个选择
a) 修改脚本并删除服务名称(当没有服务名称时,gcloud 会将其视为
default
服务)。您还可以将名称更改为default
b) 部署一个基本的 hello world 应用程序作为默认服务。您可以使用 Google App Engine 的示例应用程序之一。以下是 Python、NodeJS、PHP
的链接