parevalo / measures_collector

Tool to collect training and reference data for the measures project at Boston University
MIT License
14 stars 12 forks source link

Spreadsheet loading error (low priority) #36

Open ktarrio opened 5 years ago

ktarrio commented 5 years ago

Error below appears when typing in a valid spreadsheet -- first time this has occurred, could be a random error.

HttpAccessTokenRefreshError               Traceback (most recent call last)
~/Desktop/measures_collector/tstools/measures.py in load_everything(sender)
    446                                             measures.spreadsheet.value)
    447         measures.sheet3 = sheets.load_sheet(measures.spreadName.value, 2,
--> 448                                             measures.spreadsheet.value)
    449 
    450         # Load the sample as a feature collection

~/Desktop/measures_collector/tstools/sheets.py in load_sheet(spreadsheet, worksheet, cred_file)
      8     scope = ['https://spreadsheets.google.com/feeds' + ' ' +'https://www.googleapis.com/auth/drive']
      9     creds = ServiceAccountCredentials.from_json_keyfile_name(cred_file, scope)
---> 10     client = gspread.authorize(creds)
     11     sheet = client.open(spreadsheet).get_worksheet(worksheet)
     12     return sheet

~/anaconda3/envs/tst_online/lib/python3.7/site-packages/gspread/__init__.py in authorize(credentials, client_class)
     36     """
     37     client = client_class(auth=credentials)
---> 38     client.login()
     39     return client

~/anaconda3/envs/tst_online/lib/python3.7/site-packages/gspread/client.py in login(self)
     49 
     50             http = httplib2.Http()
---> 51             self.auth.refresh(http)
     52 
     53         self.session.headers.update({

~/anaconda3/envs/tst_online/lib/python3.7/site-packages/oauth2client/client.py in refresh(self, http)
    543                   request.
    544         """
--> 545         self._refresh(http)
    546 
    547     def revoke(self, http):

~/anaconda3/envs/tst_online/lib/python3.7/site-packages/oauth2client/client.py in _refresh(self, http)
    747         """
    748         if not self.store:
--> 749             self._do_refresh_request(http)
    750         else:
    751             self.store.acquire_lock()

~/anaconda3/envs/tst_online/lib/python3.7/site-packages/oauth2client/client.py in _do_refresh_request(self, http)
    817             except (TypeError, ValueError):
    818                 pass
--> 819             raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
    820 
    821     def _revoke(self, http):

HttpAccessTokenRefreshError: {'code': 503, 'message': 'The service is currently unavailable.', 'status': 'UNAVAILABLE'}
valpasq commented 5 years ago

We haven't tried to reproduce this yet, just noting as issues come up. Will close if problem doesn't persist.