【发布时间】:2017-08-17 17:03:38
【问题描述】:
我们有一个正在运行的 Google App Engine (GAE) 服务,我们希望将其日志下载到我们的服务器上存档。
GAE 有一个服务帐户,其凭据已作为 JSON 文件下载到我们的服务器。以下代码在我们的服务器上运行,尝试为日志服务创建客户端:
from google.cloud import logging
client = logging.Client.from_service_account_json('credentials.json')
结果:
ValueError: Service account info was not in the expected format, missing fields token_uri, client_email.
错误消息很清楚,但不清楚的是为什么在为此目的创建的 JSON 文件中需要这些字段?我们是否使用了错误类型的服务帐户的凭据?
【问题讨论】:
标签: google-app-engine google-cloud-platform