【发布时间】:2019-11-15 10:56:45
【问题描述】:
我正在尝试通过以下步骤使用编译来部署云功能。 编译由 Cloud Build 触发。
- name: 'gcr.io/cloud-builders/gcloud'
args: ['beta', 'functions',
'deploy', '${_FUNCTION_NAME}',
'--runtime', 'go111',
'--region', '${_REGION}',
'--entry-point', '${_ENTRYPOINT}',
'--env-vars-file', '.env.${_DEPLOY_ENV}.yaml',
'--trigger-topic', '${_TRIGGER_TOPIC_NAME}',
'--timeout', '${_FUNCTION_TIMEOUT}',
'--service-account', '${_SERVICE_ACCOUNT}',
'--vpc-connector', 'projects/${_PROJECT_ID}/locations/${_REGION}/connectors/${_VPC_CONNECTOR}']
dir: '${_FUNCTION_PATH}'
我通过 GCP Console 手动触发编译。
结果:
前面所有步骤都成功了。
但是这个以这个错误结束:
Starting Step #9
Step #9: Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #9: ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'items'
Step #9:
Step #9: If you would like to report this issue, please run the following command:
Step #9: gcloud feedback
Step #9:
Step #9: To check gcloud for common problems, please run the following command:
Step #9: gcloud info --run-diagnostics
Finished Step #9
ERROR
ERROR: build step 9 "gcr.io/cloud-builders/gcloud" failed: exit status 1
【问题讨论】:
-
你检查每个替换变量的值了吗?
items值在哪里?在您的.env.yaml文件中?您是否手动尝试了此命令来验证它? -
这是您的整个构建 yaml 吗?发布整件事
-
@guillaumeblaquiere 1. 我检查了变量,它们都已正确填充(cloud build 使用 resovled 命令输出日志) 2. “items”不在用于编译的文件中。 3. 我使用 cloud-build-local 成功启动了整个项目。
-
@TravisWebb 我会发布整个编译文件
-
在对整个编译文件和相应的 GCB 触发器进行三次检查后,它在 Cloud Build With Trigger 上运行良好。原因:我终于在触发器替换和编译文件之间产生了分歧。谢谢大家
标签: google-cloud-functions google-cloud-build