【发布时间】:2016-12-05 13:55:54
【问题描述】:
在尝试Google Cloud Storage sample(或使用cloudstorage 模块写入文件的任何调用,在其他项目中也是如此)时,我收到以下错误
INFO 2016-12-05 01:16:06,999 client.py:804] Refreshing access_token
INFO 2016-12-05 01:16:07,198 client.py:827] Failed to retrieve access token: {
"error" : "invalid_grant"
}
ERROR 2016-12-05 01:16:07,200 api_server.py:272] Exception while handling service_name: "app_identity_service"
method: "GetAccessToken"
request: "\n7https://www.googleapis.com/auth/devstorage.full_control"
request_id: "YpfXhQJczA"
... long long stack traces ...
RuntimeError: AccessTokenRefreshError(u'invalid_grant',)
问题是,当我将应用程序部署到 Google App Engine 时,调用工作正常。
【问题讨论】:
-
尝试导出 GOOGLE_APPLICATION_CREDENTIALS=PATH/FILE.json 。查看更多:cloud.google.com/docs/authentication/getting-started
标签: python google-app-engine google-oauth google-cloud-storage