我有一个 Cloud Run 服务设置,我有一个 Cloud Scheduler 任务,该任务调用该服务上的端点。当任务完成(http 处理程序返回)时,我看到以下错误:
请求失败,因为到实例的 HTTP 连接有错误。
但是,实际处理程序返回 HTTP 200 并成功存在。有谁知道这个错误是什么意思,在什么情况下会出现?
我还附上了日志的屏幕截图。

google-cloud-platform google-cloud-scheduler google-cloud-run
我无法让gmail api工作.我正在使用JWT进行服务器到服务器身份验证.
google-api-python-client==1.4.0
httplib2==0.9
oauth2client==1.4.7
pycrypto==2.6.1
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样.
with open(CLIENT_SECRET_FILE) as f:
data = json.loads(f.read())
private_key = data['private_key']
client_email = data['client_email']
credentials = SignedJwtAssertionCredentials(client_email, private_key, scope=OAUTH_SCOPE)
http = credentials.authorize(http)
gmail_service = build('gmail', 'v1', http=http)
try:
threads = gmail_service.users().messages().list(userId='me').execute()
except Exception as e:
print e
print e.content
Run Code Online (Sandbox Code Playgroud)
回应是
<HttpError 400 when requesting https://www.googleapis.com/gmail/v1/users/me/messages?alt=json returned "Bad Request">
{
"error": {
"errors": [
{
"domain": "global",
"reason": "failedPrecondition",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.