cormorack / yodapy

Your Ocean Data Access in Python
https://cormorack.github.io/yodapy/
MIT License
9 stars 10 forks source link

TooManyRedirects: Exceeded 30 redirects. #96

Closed robfatland closed 5 years ago

robfatland commented 5 years ago

I received the Subject error after:

from yodapy.datasources import OOI      # OOI abbreviates Ocean Observing Initiative 
ooi = OOI(); ooi.view_sites()           # list all available sites in OOI (RCO and beyond)

where the progress bar read

N/A% |                                                   |Time elapsed: 0:00:00

and I'll paste the entire message below. This code normally runs without complaint. What is the actual issue?

Full error:

TooManyRedirects                          Traceback (most recent call last)
<ipython-input-6-faa557f8bf1d> in <module>()
      1 from yodapy.datasources import OOI      # OOI abbreviates Ocean Observing Initiative
----> 2 ooi = OOI(); ooi.view_sites()           # list all available sites in OOI (RCO and beyond)

/opt/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/__init__.py in __init__(self, username, token, cloud_source)
     48         self._data_streams = pd.read_csv(os.path.join(meta_pth, 'data_streams.csv')).fillna('')  # noqa
     49 
---> 50         self._client = M2MClient(api_username=username, api_token=token)
     51         self._session = requests.session()
     52         self.username = self._client.api_username

/opt/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/m2m_client.py in __init__(self, timeout, api_username, api_token, **kwargs)
     96         self._logger.info(
     97             'Creating M2mClient instance ({:s})'.format(self._base_url))
---> 98         self.base_url = self._base_url
     99 
    100     @property

/opt/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/m2m_client.py in base_url(self, url)
    142 
    143         # Try to get the sensor invetory subsite list to see if we're able to connect
--> 144         self.fetch_subsites()
    145         if self._status_code != HTTP_STATUS_OK:
    146             self._logger.critical('Unable to connect to UFrame instance')

/opt/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/m2m_client.py in fetch_subsites(self)
    239 
    240         # Send the request
--> 241         self.send_request(request_url)
    242 
    243         if self._status_code == HTTP_STATUS_OK:

/opt/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/m2m_client.py in send_request(self, url)
    575                                             self._api_token),
    576                                       timeout=self._timeout,
--> 577                                       verify=False)
    578             else:
    579                 r = self._session.get(url, timeout=self._timeout, verify=False)

/opt/conda/lib/python3.6/site-packages/requests/sessions.py in get(self, url, **kwargs)
    535 
    536         kwargs.setdefault('allow_redirects', True)
--> 537         return self.request('GET', url, **kwargs)
    538 
    539     def options(self, url, **kwargs):

/opt/conda/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    522         }
    523         send_kwargs.update(settings)
--> 524         resp = self.send(prep, **send_kwargs)
    525 
    526         return resp

/opt/conda/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
    657 
    658         # Resolve redirects if allowed.
--> 659         history = [resp for resp in gen] if allow_redirects else []
    660 
    661         # Shuffle things around if there's history.

/opt/conda/lib/python3.6/site-packages/requests/sessions.py in <listcomp>(.0)
    657 
    658         # Resolve redirects if allowed.
--> 659         history = [resp for resp in gen] if allow_redirects else []
    660 
    661         # Shuffle things around if there's history.

/opt/conda/lib/python3.6/site-packages/requests/sessions.py in resolve_redirects(self, resp, req, stream, timeout, verify, cert, proxies, yield_requests, **adapter_kwargs)
    154 
    155             if len(resp.history) >= self.max_redirects:
--> 156                 raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects, response=resp)
    157 
    158             # Release the connection back into the pool.

TooManyRedirects: Exceeded 30 redirects.
mvardaro commented 5 years ago

OOI CI started a software update today, around 7:15am PDT. This might be related.

robfatland commented 5 years ago

yeah you can close this as I think Don says it will be more clear in the new release

On Wed, Mar 20, 2019 at 10:06 AM mvardaro notifications@github.com wrote:

OOI CI started a software update today, around 7:15am PDT. This might be related.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cormorack/yodapy/issues/96#issuecomment-474933808, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6Y2ZvWct_TFCbvo6FRcofSzdXy-uxzks5vYmo_gaJpZM4b_w16 .

-- Rob Fatland UW Research Computing Director