title: PubSub returns 503 - Service Unavailable all the time
body: <p>I created a small program in Python for reading messages from a Pub/Sub subscription. I am using Python 3.7 and google-cloud-pubsub 1.1.0.</p>
  
  <p>My code is very simple:</p>
  
  <pre><code>from google.cloud import pubsub_v1
  from google.auth import jwt
  import json
  
  service_account_info = json.load(open("service-account-info.json"))
  audience_sub = "https://pubsub.googleapis.com/google.pubsub.v1.Subscriber"
  
  credentials_sub = jwt.Credentials.from_service_account_info(
      service_account_info, audience=audience_sub
  )
  
  subscriber_ring = pubsub_v1.SubscriberClient(credentials=credentials_sub)
  
  def callback1(message):
      print("In callback!!")
      print(message.data)
      message.ack()
  
  sub_path = "projects/my-project/subscriptions/my-sub"
  future = subscriber_ring.subscribe(sub_path, callback=callback1)
  future.result()
  </code></pre>
  
  <p>When the code reaches "future.result()", it hangs there forever and times out 10 minutes later with the error </p>
  
  <p>pubsub 503 failed to connect to all addresses</p>
  
  <p>I already verified that:</p>
  
  <ul>
  <li>Pub/Sub is up and running</li>
  <li>My service account has all the needed permissions. I even tried with my personal Google Cloud account (I am the project owner) with the same results.</li>
  <li>There are unacked messages in the Topic</li>
  <li>My network connection is OK</li>
  </ul>
  
  <p>but I cannot make it work. Any ideas?</p>
  
  <p>EDIT: I got some more info from the exception:</p>
  
  <pre><code>om_grpc_error(exc), exc)
    File "&lt;string&gt;", line 3, in raise_from
  google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/usr/local/anaconda3/envs/loadtest/lib/python3.7/site-packages/google/cloud/pubsub_v1/publisher/_batch/thread.py", line 219, in _commit
      response = self._client.api.publish(self._topic, self._messages)
    File "/usr/local/anaconda3/envs/loadtest/lib/python3.7/site-packages/google/cloud/pubsub_v1/gapic/publisher_client.py", line 498, in publish
      request, retry=retry, timeout=timeout, metadata=metadata
    File "/usr/local/anaconda3/envs/loadtest/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
      return wrapped_func(*args, **kwargs)
    File "/usr/local/anaconda3/envs/loadtest/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
      on_error=on_error,
    File "/usr/local/anaconda3/envs/loadtest/lib/python3.7/site-packages/google/api_core/retry.py", line 206, in retry_target
      last_exc,
    File "&lt;string&gt;", line 3, in raise_from
  google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling functools.partial(&lt;function _wrap_unary_errors.&lt;locals&gt;.error_remapped_callable at 0x7fa030891a70&gt;, 
  
  
  , metadata=[('x-goog-request-params', 'topic=projects/my-project/subscriptions/my-sub'), ('x-goog-api-client', 'gl-python/3.7.6 grpc/1.26.0 gax/1.16.0 gapic/1.2.0')]), last exception: 503 failed to connect to all addresses
  </code></pre>