Frequent HTTP 500 Internal Errors with Google Drive drive.files.get API(Google Drive drive.files.get API 的常见 HTTP 500 内部错误)
问题描述
我们有一项高度依赖 Google Drive 的服务(它使用 PythonSDK),我们的服务会通过 Google Drive 集合和文件.
We have a service which is highly dependent on Google Drive (it uses the Python SDK), our service goes through Google Drive collections and files.
查看生产日志,我们发现调用Google Drive的drive.files.get
API端点时有很多HTTP 500 Server Internal Errors.错误率约为 0.5%.经过调查,发现极端情况是一小时内连续9次HTTP 500失败.
Checking the production log, we found that there are many HTTP 500 Server Internal Errors when we call Google Drive's drive.files.get
API endpoint. The error rate is about 0.5%. After investigating, I found that the extreme case is continuous 9 HTTP 500 failure in one hour.
异常如下所示:
File "/home/xxxxxx/xxxxxxx/storage.py", line 1185, in get_file
gdrive_file = self.client.files().get(fileId='0Bxn2GmQxR4zHYlNvaUlFNjl6MkE', fields='id,title,modifiedDate,createdDate,fileSize,mimeType,downloadUrl,labels').execute()
File "/usr/lib/python2.7/dist-packages/apiclient/http.py", line 389, in execute
raise HttpError(resp, content, self.uri)
HttpError: <HttpError 500 when requesting https://www.googleapis.com/drive/v2/files/0Bxn2GmQxR4zHYlNvaUlFNjl6MkE?fields=id%2Ctitle%2CmodifiedDate%2CcreatedDate%2CfileSize%2CmimeType%2CdownloadUrl%2Clabels&alt=json returned "Internal Error">
我们的服务托管在美国 WEST-2 数据中心的 Amazon Web Service 上.
Our service is hosted on Amazon Web Service, in the US WEST-2 data center.
有人遇到过类似的问题吗?任何帮助表示赞赏.
Has anyone had a similar issue? Any help is appreciated.
推荐答案
这与我看到的错误率大致相同.只需进行指数退避并重试即可.
That's approximately the same error rate I see. Just do an exponential backoff and retry.
这篇关于Google Drive drive.files.get API 的常见 HTTP 500 内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Google Drive drive.files.get API 的常见 HTTP 500 内部错误


- pytorch 中的自适应池是如何工作的? 2022-07-12
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- 沿轴计算直方图 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01