Connect google datastore from existing google compute engine in python

对着背影说爱祢 提交于 2019-12-11 01:36:36

问题


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 ;)


回答1:


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.



来源:https://stackoverflow.com/questions/21901610/connect-google-datastore-from-existing-google-compute-engine-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!