在python中从现有的Google计算引擎连接谷歌数据存储 [英] Connect google datastore from existing google compute engine in python

查看:161
本文介绍了在python中从现有的Google计算引擎连接谷歌数据存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从现有的计算引擎实例连接到数据存储,我得到:




[Python 2.7版 - googledatastore- v1beta2_rev1_2.1.0-py2.7]



googledatastore.connection.RPCError:提交与HTTP RPC客户端失败(403)禁止:未经授权的


数据存储API已启用,权限已设置,但GCE位于不同区域,一个项目 其他?



GCE ENV:

  DATASTORE_DATASET = PROJECT_ID 
DATASTORE_PRIVATE_KEY_FILE =绝对路径PEM文件
DATASTORE_SERVICE_ACCOUNT = SERVICE_ACCOUNT_EMAIL

任何提示,我应该怎么办/检查?我很困惑,因为我在本地环境中的配置完全相同 - 当我点击pyCharm中的play时,一切正常;)

也许我错过了一些东西.. 。



感谢您的帮助;)

解决方案

目前Cloud Datastore客户端库中的错误。如果您在GCE运行,它会尝试使用范围的规则,然后在尝试其他验证方法之前失败。


I'm trying to connect to Datastore from existing compute engine instance and I'm getting:

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

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

the Datastore API is enabled, Permissions is set but GCE is in different zone, one project

what else ?

GCE env:

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

Any tips what should I do/check ? I'm confused because I have exactly the same configuration in my local environment - when I click "play" in pyCharm everything works well ;)

Maybe I missed something...

Thanks for your help ;)

解决方案

This is currently a bug in the Cloud Datastore client library. If you are running on GCE, it will try to use the scope rules and then fail before trying other authentication methods.

这篇关于在python中从现有的Google计算引擎连接谷歌数据存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆