google-cloud-platform - 谷歌云功能部署开始失败
问题描述
今天开始,我无法使用 gcloud cli 部署云功能。
这是我部署云功能的 gloud 命令:
gcloud functions deploy chatbot_api_gateway_002_test --runtime python37 --trigger-http --entry-point process --set-env-vars VERIFICATION_TOKEN=sometokenhere,PUBSUB_TOPIC=entrypointfunction001,GOOGLE_CLOUD_PROJECT=cs-be-dev,DEST_URL=__undefined_yet__,DEST_URLS_TIMEOUT=2 --memory=2GB --region=asia-northeast1
我收到一个错误:
部署功能(可能需要一段时间 - 最多 2 分钟)...失败。
错误:(gcloud.functions.deploy)OperationError:代码= 3,消息=构建失败:构建已超时
1 小时前我曾经使用相同的脚本,但现在 - 团队中没有人能够部署云功能并得到相同的错误。
在 stackdrive 日志中,我只看到这个:
{
insertId: "rr5a8qctoo"
logName: "projects/be-dev/logs/cloudaudit.googleapis.com%2Factivity"
operation: {
id: "operations/c2F0YWNzLWJlLWRldi9hc2lhLW5vcnRoZWFzdDEvY2hhdGJvdF9hcGlfZ2F0ZXdheV8wMDJfdGVzdC9SMGdpR0ZRWk13aw"
last: true
producer: "cloudfunctions.googleapis.com"
}
protoPayload: {
@type: "type.googleapis.com/google.cloud.audit.AuditLog"
authenticationInfo: {
principalEmail: "myemail@domain.com"
}
methodName: "google.cloud.functions.v1.CloudFunctionsService.CreateFunction"
requestMetadata: {
destinationAttributes: {
}
requestAttributes: {
}
}
resourceName: "projects/be-dev/locations/asia-northeast1/functions/chatbot_api_gateway_002_test"
serviceName: "cloudfunctions.googleapis.com"
status: {
code: 3
message: "INVALID_ARGUMENT"
}
}
receiveTimestamp: "2020-02-05T09:53:42.771914617Z"
resource: {
labels: {
function_name: "chatbot_api_gateway_002_test"
project_id: "be-dev"
region: "asia-northeast1"
}
type: "cloud_function"
}
severity: "ERROR"
timestamp: "2020-02-05T09:53:42.153Z"
}
请问有什么解决方法的建议吗?
解决方案
它读取message: "INVALID_ARGUMENT"
的任何参数都可能不正确(更改日志有时会列出重大更改)。查看gcloud functions deploy
和比较;例如:
允许的值为:128MB、256MB、512MB、1024MB 和 2048MB。
因此2GB
可能最终是一个INVALID_ARGUMENT
并且(NAME : --region=REGION)
也被声明为一个位置参数。尝试使用--verbosity=info
or获得更多输出debug
:
gcloud functions deploy \
chatbot_api_gateway_002_test \
--region=asia-northeast1 \
--runtime python37
--trigger-http \
--memory=2048MB \
--verbosity=info
--entry-point
通常是函数的目录名,
例如。helloworld
作为functions/helloworld/main.py
入口点。
推荐阅读
- python - 在 Tavern 1.0.0 中保存变量
- python - 了解 Python Subprocess.run 阻塞
- javascript - Plotly js中的高效3D线图?
- android - 订阅 observable:RxJava + Retrofit + Repository 模式
- reactjs - 如何确定用户是否使用箭头键滚动选择 Material-UI 自动完成?
- python - 在使用 keras 模型之前按列标准化数据
- javascript - 为什么'用 insertBefore 注入避免 appendChild 错误'?
- python-3.x - 空路径与这些 URL 中的任何一个都不匹配
- linux - 如何将大块行存储在shell中的变量中
- python - 在 python,pandas,openpyxl 中拆分或文本到列标题单元格