简体   繁体   中英

Unable to call discovery.build('compute', 'v1', credentials=credentials) from GCE

On running the build command it is getting timed out.

from googleapiclient import discovery
from oauth2client.client import GoogleCredentials

credentials = GoogleCredentials.get_application_default()
service = discovery.build('compute', 'v1', credentials=credentials)

I am running this on compute engine only with properly setting env. This was working earlier. I am able to run service = discovery.build('storage', 'v1', credentials=credentials) Error I am getting now

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 250, in build
    developerKey, num_retries=num_retries
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 316, in _retrieve_discovery_doc
    resp, content = req.execute(num_retries=num_retries)
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 901, in execute
    headers=self.headers,
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 204, in _retry_request
    raise exception
ssl.SSLError: ('The read operation timed out',)

Is there some issue with compute engine API? Any lead will be helpful.

This is a known temporary issue. From https://status.cloud.google.com/

Google's API Discovery Service GetRest ( https://www.googleapis.com/discovery/v1/apis/pubsub/v1/rest ) requests are hanging in the following regions: asia-northeast1, asia-northeast2, asia-northeast3, asia-southeast1, europe-west1,europe-west3, europe-west6, europe-west4, northamerica-northeast1,southamerica-east1,us-central1, us-east1, us-west1, us-west2, and us-west4.

We are currently working to mitigate by rolling back a configuration change. Next update time is Thursday, 2020-10-08 07:00 US/Pacific.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM