Connect google datastore from existing google compute engine in python

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

Upvotes: 2

Views: 386

Answers (1)

Patrick Costello
Patrick Costello

Reputation: 3626

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.

Upvotes: 1

Related Questions