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 — PubSub client example: StatusCode.PERMISSION_DENIED · Issue #697 · GoogleCloudPlatform/python-docs-samples

PubSub client example: StatusCode.PERMISSION_DENIED #697

New issue
Copy link
New issue
Copy link
Closed
Closed
PubSub client example: StatusCode.PERMISSION_DENIED#697
Copy link
Assignees
ryanmats

Description

@bluecmd
bluecmd
opened on Dec 3, 2016
Issue body actions

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/pubsub/cloud-client/publisher.py

Did you change the file? If so, how?

Nope.

Describe the issue

$ python publisher.py list
Traceback (most recent call last):
  File "publisher.py", line 93, in <module>
    list_topics()
  File "publisher.py", line 33, in list_topics
    for topic in pubsub_client.list_topics():
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/iterator.py", line 210, in _items_iter
    for page in self._page_iter(increment=False):
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/iterator.py", line 239, in _page_iter
    page = self._next_page()
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/iterator.py", line 437, in _next_page
    items = six.next(self._gax_page_iter)
  File "/usr/local/lib/python2.7/dist-packages/google/gax/__init__.py", line 435, in next
    return self.__next__()
    errors.create_error('RPC failed', cause=exception))
google.gax.errors.GaxError: GaxError(RPC failed, caused by <_Rendezvous of RPC that terminated with (StatusCode.PERMISSION_DENIED, User not authorized to perform this action.)>)

Running the pubsub.projects.topics.list api from https://developers.google.com/apis-explorer workst just fine.

I'm running this inside the Cloud Shell on a project with Cloud Pub/Sub API enabled and some topics set up. gcloud auth list shows my account, cloud auth login greatly discourages me to use it inside a Cloud Shell so I haven't tried refreshing my credentials.

Activity

  1. theacodes
    assigned
    theacodes
    and
    ryanmats
    and unassigned
    theacodes
    on Dec 5, 2016
  2. theacodes commented on Dec 5, 2016

    @theacodes
    theacodes
    on Dec 5, 2016
    Contributor
    More actions

    @bluecmd there may be something wonky with the cloud shell credentials.

    @ryanmats can you take a look?

  3. ryanmats commented on Dec 5, 2016

    @ryanmats
    ryanmats
    on Dec 5, 2016
    Contributor
    More actions

    @bluecmd Hi Christian! I just looked at your issue and it looks like you can resolve it by generating a service account key file in JSON (https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount). Once this file is downloaded to your computer, move it to a desired location in the Cloud Shell and set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path to the key file, for example:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json

    This information is in ~/python-docs-samples/pubsub/cloud-client/README.rst

    Thanks, and happy holidays!

  4. ryanmats
    closed this as completedon Dec 5, 2016
  5. bluecmd commented on Dec 5, 2016

    @bluecmd
    bluecmd
    on Dec 5, 2016
    Author
    More actions

    @ryanmats Thanks, but surely that should Just Work(tm) on the cloud shell? "Once that file is downloaded to your computer" doesn't really work that well in Cloud Shell and is quite inconvenient.

  6. theacodes commented on Dec 5, 2016

    @theacodes
    theacodes
    on Dec 5, 2016
    Contributor
    More actions

    @bluecmd indeed. We're aware of this problem. It's due to a quirk in how cloud shell provides credentials. We've referenced this github issue on the internal bug, and we'll update if there's a resolution.

  7. bluecmd commented on Dec 5, 2016

    @bluecmd
    bluecmd
    on Dec 5, 2016
    Author
    More actions

    @jonparrott Thanks!

  8. mritchie712 commented on Oct 21, 2017

    @mritchie712
    mritchie712
    on Oct 21, 2017
    More actions

    Any update here? Running into the same issue.

  9. csantanaes commented on Jan 9, 2018

    @csantanaes
    csantanaes
    on Jan 9, 2018
    More actions

    news about this error?

  10. theacodes commented on Jan 9, 2018

    @theacodes
    theacodes
    on Jan 9, 2018
    Contributor
    More actions

    You should use a service account as described here: https://cloud.google.com/docs/authentication/getting-started

  11. chalmerlowe
    added 2 commits that reference this issue on Feb 19, 2026

    chore(deps): update dependency google-cloud-logging to v3.4.0 (#697)

    66566cc

    chore(deps): update dependency google-cloud-logging to v3.4.0 (#697)

    65ad0d7
  12. chalmerlowe
    added a commit that references this issue on Apr 7, 2026

    chore(deps): update dependency google-cloud-storage to v2.1.0 (#697)

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

Metadata

Metadata

Assignees

  • @ryanmats
    ryanmats

Labels

No labels
No labels

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.