Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PubSub client example: StatusCode.PERMISSION_DENIED #697

Copy link
Copy link

Description

@bluecmd
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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.