PattoMotto/ftx-portfolio-monitoring

Quota exceeded for quota metric 'Read requests' and limit 'Read requests per minute per user' of service 'sheets.googleapis.com'

vensilver opened this issue · 2 comments

Traceback (most recent call last):
File "/home/vensilver/ftxp/pmPortfolioMonitoringBot.py", line 57, in loop
self.writeRecord(subaccount, dataframe)
File "/home/vensilver/ftxp/pmPortfolioMonitoringBot.py", line 108, in writeRecord
gsheet.clearWorksheet(fileName=self.gSheetName, worksheetName=worksheetName, range='A:F')
File "/home/vensilver/ftxp/gsheetHelper.py", line 39, in clearWorksheet
for worksheet in spreadsheet.worksheets():
File "/home/vensilver/.local/lib/python3.8/site-packages/gspread/spreadsheet.py", line 301, in worksheets
sheet_data = self.fetch_sheet_metadata()
File "/home/vensilver/.local/lib/python3.8/site-packages/gspread/spreadsheet.py", line 243, in fetch_sheet_metadata
r = self.client.request("get", url, params=params)
File "/home/vensilver/.local/lib/python3.8/site-packages/gspread/client.py", line 71, in request
raise APIError(response)
gspread.exceptions.APIError: {'code': 429, 'message': "Quota exceeded for quota metric 'Read requests' and limit 'Read requests per minute per user' of service 'sheets.googleapis.com' for consumer 'project_number:504486318658'.", 'status': 'RESOURCE_EXHAUSTED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'RATE_LIMIT_EXCEEDED', 'domain': 'googleapis.com', 'metadata': {'consumer': 'projects/504486318658', 'quota_metric': 'sheets.googleapis.com/read_requests', 'quota_limit': 'ReadRequestsPerMinutePerUser', 'service': 'sheets.googleapis.com'}}]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "start_bot.py", line 18, in
monitoringBot.loop()
File "/home/vensilver/ftxp/pmPortfolioMonitoringBot.py", line 73, in loop
exc_type, exc_tb = sys.exc_info()
ValueError: too many values to unpack (expected 2)

I increased the sleep time to 10 sec for now

Cool, I'll take a look and update it. Thanks