python - 在 python 中从现有的谷歌计算引擎连接谷歌数据存储

标签 python google-app-engine google-cloud-datastore

我正在尝试从现有的计算引擎实例连接到 Datastore,我得到:

[ python 2.7 - googledatastore-v1beta2_rev1_2.1.0-py2.7 ]

googledatastore.connection.RPCError: commit RPC client failure with HTTP(403) Forbidden: Unauthorized.

Datastore API 已启用,权限已设置但 GCE 位于不同区域,一个项目

还有什么?

GCE 环境:

DATASTORE_DATASET = project_id
DATASTORE_PRIVATE_KEY_FILE = absolute path to pem file
DATASTORE_SERVICE_ACCOUNT = service_account_email

任何提示我应该做什么/检查?我很困惑,因为我在本地环境中具有完全相同的配置 - 当我在 pyCharm 中单击“播放”时,一切正常;)

也许我错过了什么......

感谢您的帮助;)

最佳答案

目前这是一个 bug in the Cloud Datastore client library .如果您在 GCE 上运行,它将尝试使用 scope rules然后在尝试其他身份验证方法之前失败。

关于python - 在 python 中从现有的谷歌计算引擎连接谷歌数据存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21901610/

相关文章:

java - 在 GWT 中查找应用程序名称

google-app-engine - Android Studio 无法识别 gradle 2.10

java - 如何更新 GAE 数据存储中的 boolean 值?

python - 如何访问 GAE ndb Python 中的所有重复结构化属性

python - 从 Python 中的字符串中删除特定字符

python - 在 Python 中拦截方法调用

python - 为什么在我使用 Google App Engine 呈现 html 文件后我的 html 文件中没有处理我的 css 命令?

Python对象检查获取用户设置的参数值

python - 为什么在使用 pandas apply 后我的数据框中出现空行?

python - ndb 事务中访问的最大实体组数的定义?