googleapis / python-pubsub

Apache License 2.0
392 stars 205 forks source link

504 Deadline Exceeded #1210

Closed QuangLe1997 closed 1 month ago

QuangLe1997 commented 4 months ago

i have code

from google.cloud import pubsub_v1

if __name__ == '__main__':
    publisher = pubsub_v1.PublisherClient(
        credentials="/Users/quang/.config/gcloud/application_default_credentials.json"
    )
    a = publisher.list_topics(
        timeout=10,
    )
    print(a)

it raise error in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded

mukund-ananthu commented 1 month ago

In the code, you are attempting to list the topics, without specifying which project you want to list the topics in, which won't work. Refer https://cloud.google.com/pubsub/docs/samples/pubsub-list-topics#code-sample for the public documentation for listing topics using the Python client library.

Closing this since this is not an issue with the client library.