Traceback (most recent call last):
File "receive.py", line 19, in <module>
subscription = subscriber.create_subscription(topic, subscription_name)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/_gapic.py", line 42, in <lambda>
fx = lambda self, *a, **kw: wrapped_fx(self.api, *a, **kw)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/cloud/gapic/pubsub/v1/subscriber_client.py", line 445, in create_subscription
return self._create_subscription(request, options)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 452, in inner
return api_caller(api_call, this_settings, request)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 438, in base_caller
return api_call(*args)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 376, in inner
return a_func(*args, **kwargs)
File "/path-to-file/pubsub/env/local/lib/python2.7/site-packages/google/gax/retry.py", line 127, in inner
' classified as transient', exception)
google.gax.errors.RetryError: RetryError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, Invalid resource name given (name=projects/PROJECTID/topics/TOPICNAME). Refer to https://cloud.google.com/pubsub/overview#names for more information.)>)
Note that I've copied/pasted the code example and edited the projectID, topic name and subscription name to be valid for my project. Also note that using the example from readthedocs.io (which is the same) generates the exact same error
Subscription quickstart documentation for Pub/Sub library is not correct in a couple of points.
The final
subscriptionhere should besubscription_name.Using it as is throws the following error:
NameError: name 'subscription' is not definedAfter modifying the line from 1 above to
it throws another error:
Note that I've copied/pasted the code example and edited the projectID, topic name and subscription name to be valid for my project. Also note that using the example from readthedocs.io (which is the same) generates the exact same error