0

在运行构建命令时,它会超时。

from googleapiclient import discovery
from oauth2client.client import GoogleCredentials

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

我仅在正确设置环境的情况下在计算引擎上运行它。这是早些时候工作的。我能够运行service = discovery.build('storage', 'v1', credentials=credentials) 我现在得到的错误

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',)

计算引擎 API 有问题吗?任何线索都会有所帮助。

4

1 回答 1

1

这是一个已知的临时问题。来自https://status.cloud.google.com/

Google 的 API 发现服务 GetRest ( https://www.googleapis.com/discovery/v1/apis/pubsub/v1/rest ) 请求在以下区域挂起:asia-northeast1、asia-northeast2、asia-northeast3、asia-东南1、欧洲-西部1、欧洲-西部3、欧洲-西部6、欧洲-西部4、北美-东北1、南部-东部1、美国-中央1、美国-东部1、美国-西部1、美国-西部2和美国-西部4。

我们目前正在努力通过回滚配置更改来缓解。下次更新时间为 2020 年 10 月 8 日星期四 07:00 美国/太平洋。

于 2020-10-08T09:00:16.847 回答