Google Sheets API HttpError 500和503 [英] Google Sheets API HttpError 500 and 503

查看:60
本文介绍了Google Sheets API HttpError 500和503的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已解决,问题出在Google一边.请求图纸中包含无效间隔的图表时发生.向Google报告了错误.

solved, the issue was on Google's side. Occurs when requesting a sheet which had diagrams that had invalid intervals in them. Reported bug to Google.

注意:此问题已持续2天以上.我以前有过,但是经过一天的等待,它会自动解决.自从重新安装以来.

Note: This issue has persisted for more than 2 days. I had it previously but it was automatically resolved after waiting a day. It has since rearisen.

我目前正在通过Google的python api客户端使用Google Sheets API.身份验证是OAuth2.0,我没有更改代码库中的任何重要内容,但突然我得到了100%的错误率,看来应该在Google的尽头.我担心我会被无限期地禁止使用API​​,是这种情况吗?我的猜测是,当我启动脚本并立即使用ctrl + c取消该脚本时,因为我想运行该脚本的新版本会导致一些问题.

I am currently using the Google Sheets API through Google's python api client. The authentication is OAuth2.0 and I did not change anything significant in my codebase but all of the sudden I am getting 100% error ratio, and it seems like it should be on Google's end. I fear that I am banned from using the API indefinitely, is this the case? My guess is that when I launched the script and immediately cancelled it with ctrl+c because I wanted to run a new version of it caused some issues.

我尝试创建另一个项目,并使用其凭据发出请求,并遇到相同的错误.试图让我的朋友通过他的Google帐户运行脚本身份验证,但他收到了相同的错误.可以在此处找到独立的源代码

I tried creating another project and using its credentials to make the request and got the same error. Tried having my friend run the script authenticating through his google account and he receives the same error. The independent source code can be found here

关于源代码:get_credentials()(并因此进行身份验证)完全从Google的python快速入门脚本复制而来,如此处 https://developers.google.com/sheets/quickstart/python .

About the source code: The get_credentials() (and therefore the authentication) is entirely copied from Google's python quickstart script as seen here https://developers.google.com/sheets/quickstart/python.

跟踪:

Traceback (most recent call last):
  File "Google_sheets.py", line 164, in <module>
    ss=Spreadsheet(SPREADSHEET_ID)
  File "Google_sheets.py", line 83, in __init__
    spreadsheetId=self.ssId, includeGridData=True).execute()['sheets']}
  File "C:\Users\Larsson\AppData\Local\Programs\Python\Python35-32\lib\site-packages\oauth2client\util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\Larsson\AppData\Local\Programs\Python\Python35-32\lib\site-packages\googleapiclient\http.py", line 838, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 500 when requesting https://sheets.googleapis.com/v4/spreadsheets/12YdppOoZUNZxhXvcY_cRgfXEfRnR_izlBsF8Sin3rw4?alt=json&includeGridData=true returned "Internal error encountered.">

稍后重试后,我又收到另一个错误:

After retrying shortly after, I get another error:

Traceback (most recent call last):
  File "Google_sheets.py", line 164, in <module>
    ss=Spreadsheet(SPREADSHEET_ID)
  File "Google_sheets.py", line 83, in __init__
    spreadsheetId=self.ssId, includeGridData=True).execute()['sheets']}
  File "C:\Users\Larsson\AppData\Local\Programs\Python\Python35-32\lib\site-packages\oauth2client\util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\Larsson\AppData\Local\Programs\Python\Python35-32\lib\site-packages\googleapiclient\http.py", line 838, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 503 when requesting https://sheets.googleapis.com/v4/spreadsheets/12YdppOoZUNZxhXvcY_cRgfXEfRnR_izlBsF8Sin3rw4?includeGridData=true&alt=json returned "The service is currently unavailable.">

推荐答案

已解决,问题出在Google一边.请求表格中包含无效/未选择间隔的图表时发生.向Google报告了错误.

Solved, the issue was on Google's side. Occurs when requesting a sheet which had diagrams that had invalid/unselected intervals in them. Reported bug to Google.

通过将所有无效图更改为有效范围来修复.

Fix by changing all invalid diagrams to valid ranges.

这篇关于Google Sheets API HttpError 500和503的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆