GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Service account throws 503 Backend Error when executing gcloud.datastore.Query() · Issue #869 · googleapis/google-cloud-python

Service account throws 503 Backend Error when executing gcloud.datastore.Query() #869

New issue
Copy link
New issue
Copy link
Closed
Closed
Service account throws 503 Backend Error when executing gcloud.datastore.Query()#869
Copy link
Assignees
jgeewax
Labels
api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Description

@charlesbclifford
charlesbclifford
opened on May 10, 2015
Issue body actions

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:

CLOUDSDK_CONFIG
CLOUDSDK_PYTHON
GOOGLE_APPLICATION_CREDENTIALS

And, $ gcloud auth activate-service-account has been run, to make the service account the 'active' credentials.

The Cloud Datastore API is enabled on the GCP project.

Also, 'gcloud config set project' has been run.

Any suggestions on how to correct this (credentials configuration) mistake are appreciated.

Activity

  1. jgeewax commented on May 10, 2015

    @jgeewax
    jgeewax
    on May 10, 2015
    Contributor
    More actions

    Is tmp the name of your project / dataset ID ?

    datastore.set_default_dataset_id('tmp')

    Seems like this should be:

    datastore.set_default_dataset_id('your-project-id-here')
  2. jgeewax
    added
    type: questionRequest for information or clarification. Not an issue.
    api: datastoreIssues related to the Datastore API.
    on May 10, 2015
  3. dhermes commented on May 10, 2015

    @dhermes
    dhermes
    on May 10, 2015
    Contributor
    More actions

    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.

  4. charlesbclifford commented on May 10, 2015

    @charlesbclifford
    charlesbclifford
    on May 10, 2015
    Author
    More actions

    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.

  5. jgeewax commented on May 10, 2015

    @jgeewax
    jgeewax
    on May 10, 2015
    Contributor
    More actions

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

  6. jgeewax
    closed this as completedon May 10, 2015
  7. JustinBeckwith
    assigned
    jgeewax
    on Feb 1, 2021
  8. parthea
    added 7 commits that reference this issue on Nov 24, 2025

    fix: also add the async client to __all__ (#869)

    cd5d2f9

    build(deps): bump cryptography from 39.0.1 to 41.0.0 in /synthtool/gc…

    fd3ab4c

    chore: update copyright year (#869)

    aabe465

    chore: remove nox uninstall/reinstall from python build.sh template (#…

    faaf803

    test: Uncomment some old tests (#869)

    76eddcd

    chore: remove nox uninstall/reinstall from python build.sh template (#…

    3e045ad

    chore: relocate owl bot post processor (#869)

    7f24797
  9. parthea
    added 2 commits that reference this issue on Feb 13, 2026

    feat: Auto enable mTLS when supported certificates are detected (#869)

    3cd26af

    chore: librarian release pull request: 20260108T134327Z (#883)

    b6f1ec6
  10. parthea
    added 2 commits that reference this issue on Mar 6, 2026

    chore: fix INSTALL_LIBRARY_FROM_SOURCE in noxfile.py (#869)

    d1ea44a

    chore(deps): update dependency google-cloud-pubsub to v2.13.7 (#869)

    f88e128
  11. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jgeewax
    jgeewax

Labels

api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.