【发布时间】:2020-02-28 15:29:16
【问题描述】:
我正在使用 Cloud Run、Endpoints 和 Cloud Functions 来构建 API 服务。有多个端点运行良好,但我无法再部署任何新端点。
Cloud Run 环境出现错误,导致其无法调用相应的 Cloud Function。奇怪的是,所有其他端点都可以正常工作,但我无法创建新端点。
我找到了这篇文章:https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors,但它仅适用于 BAD_GATEWAY 错误代码。 所有代码都部署得很好。部署 Cloud Function、Cloud Run 或 Open API yaml 文件时没有错误。
响应错误:
{
"code": 13,
"message": "INTERNAL_SERVER_ERROR",
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"stackEntries": [],
"detail": "application"
}
]
}
Cloud Run 中的错误:
5#5: *33 invalid URL prefix in "", client: xxxxx, server: , request: "GET /user HTTP/1.1", host: "[my cloud run host]"
GET 500 404 B4 ms python-requests/2.22.0 [cloud run host]/user
main.py 文件:
def user(request):
return "Ok"
yaml 文件:
/user:
x-google-backend:
address: https://[cloud functions host]/user
get:
summary: Retrieves a user.
operationId: getUser
responses:
'200':
description: A successful response
'400':
description: BAD_REQUEST
【问题讨论】:
-
Stackdriver Logging 中是否记录了任何错误?
-
查看“Cloud Run 中的错误”下的错误
标签: google-cloud-platform google-cloud-functions google-cloud-endpoints google-cloud-run