You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Service account throws 503 Backend Error when executing gcloud.datastore.Query() #869
See below the python script which throws the 50 error. The credentials being used are those of a GCP service account.
$ python
Python 2.7.8 (default, Apr 15 2015, 09:26:43)
[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gcloud import datastore
>>> datastore.set_default_dataset_id('tmp')
>>> datastore_conn = datastore.get_connection()
>>> datastore.set_default_connection(datastore_conn)
>>> q=datastore.Query('foo')
>>> print list(q.fetch())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/gcloud/datastore/query.py", line 421, in __iter__
self.next_page()
File "/usr/lib/python2.7/site-packages/gcloud/datastore/query.py", line 388, in next_page
transaction_id=transaction and transaction.id,
File "/usr/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 257, in run_query
datastore_pb.RunQueryResponse)
File "/usr/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 108, in _rpc
data=request_pb.SerializeToString())
File "/usr/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 85, in _request
raise make_exception(headers, content, use_json=False)
gcloud.exceptions.ServiceUnavailable: 503 Backend Error
These .bashrc environment variables have been set, and last is set to use the service account:
I should also note that gcloud config set project and gcloud auth activate-service-account will have no bearing on this library. However, setting GOOGLE_APPLICATION_CREDENTIALS will be sufficient.
Wow! That is the fix!
Too bad the documentation does not make it clear that the literal data value of the gcloud.datastore 'dataset_id' config param must match the literal data value of the GCP project_id.
Gotcha -- right now Dataset ID and Project ID are one-to-one. Eventually you'll be able to create new Datasets in the UI, and it'll make much more sense :)
Activity
jgeewax commentedon May 10, 2015
Is
tmpthe name of your project / dataset ID ?Seems like this should be:
dhermes commentedon May 10, 2015
I should also note that
gcloud config set projectandgcloud auth activate-service-accountwill have no bearing on this library. However, settingGOOGLE_APPLICATION_CREDENTIALSwill be sufficient.charlesbclifford commentedon May 10, 2015
Wow! That is the fix!
Too bad the documentation does not make it clear that the literal data value of the gcloud.datastore 'dataset_id' config param must match the literal data value of the GCP project_id.
jgeewax commentedon May 10, 2015
Gotcha -- right now Dataset ID and Project ID are one-to-one. Eventually you'll be able to create new Datasets in the UI, and it'll make much more sense :)
fix: also add the async client to __all__ (#869)
build(deps): bump cryptography from 39.0.1 to 41.0.0 in /synthtool/gc…
chore: update copyright year (#869)
chore: remove nox uninstall/reinstall from python build.sh template (#…
test: Uncomment some old tests (#869)
chore: remove nox uninstall/reinstall from python build.sh template (#…
chore: relocate owl bot post processor (#869)
feat: Auto enable mTLS when supported certificates are detected (#869)
chore: librarian release pull request: 20260108T134327Z (#883)
chore: fix INSTALL_LIBRARY_FROM_SOURCE in noxfile.py (#869)
chore(deps): update dependency google-cloud-pubsub to v2.13.7 (#869)
docs: migrate code from googleapis/python-bigquery (#18303)