403 forbidden errors running test suite during conda build
When running the test suite as part of the gracedb-sdk
conda build, I get the same 403 (forbidden) error three times:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gracedb-test.ligo.org/api/superevents/TS110914avv/signoffs/
Full pytest log
+ python -m pytest --pyargs gracedb_sdk
============================= test session starts ==============================
platform darwin -- Python 3.8.0, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: $SRC_DIR
collected 53 items
tests/test_api.py ................................................F..FF [100%]
=================================== FAILURES ===================================
___________________________ test_superevents_expose ____________________________
client = <gracedb_sdk.Client object at 0x106ba3e20>
superevents_create = {'category': 'Test', 'coinc_far': None, 'created': '2020-01-03 13:49:18 UTC', 'em_events': [], ...}
def test_superevents_expose(client, superevents_create):
superevent_id = superevents_create['superevent_id']
> client.superevents[superevent_id].expose()
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/tests/test_api.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/api/event.py:69: in expose
self._modify_permissions('expose')
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/api/event.py:57: in _modify_permissions
self.client.post(url, data={'action': action})
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:581: in post
return self.request('POST', url, data=data, json=json, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/file.py:72: in request
return super(SessionFileMixin, self).request(
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:533: in request
resp = self.send(prep, **send_kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:653: in send
r = dispatch_hook('response', hooks, r, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/hooks.py:31: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/errors.py:3: in _hook_raise_errors
response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [403]>
def raise_for_status(self):
"""Raises stored :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
reason = self.reason.decode('iso-8859-1')
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
elif 500 <= self.status_code < 600:
http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gracedb-test.ligo.org/api/superevents/TS110914avr/permissions/modify/
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/models.py:940: HTTPError
____________________ test_superevents_signoff_advocate[OK] _____________________
client = <gracedb_sdk.Client object at 0x106ba3e20>
superevents_create = {'category': 'Test', 'coinc_far': None, 'created': '2020-01-03 13:49:28 UTC', 'em_events': [], ...}
status = 'OK'
@pytest.mark.parametrize('status', ['OK', 'NO'])
def test_superevents_signoff_advocate(client, superevents_create, status):
superevent_id = superevents_create['superevent_id']
client.superevents[superevent_id].labels.create('ADVREQ')
> client.superevents[superevent_id].signoff('ADV', status, comment='foo')
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/tests/test_api.py:396:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/api/event.py:83: in signoff
self.client.post(url, data=data)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:581: in post
return self.request('POST', url, data=data, json=json, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/file.py:72: in request
return super(SessionFileMixin, self).request(
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:533: in request
resp = self.send(prep, **send_kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:653: in send
r = dispatch_hook('response', hooks, r, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/hooks.py:31: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/errors.py:3: in _hook_raise_errors
response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [403]>
def raise_for_status(self):
"""Raises stored :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
reason = self.reason.decode('iso-8859-1')
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
elif 500 <= self.status_code < 600:
http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gracedb-test.ligo.org/api/superevents/TS110914avu/signoffs/
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/models.py:940: HTTPError
____________________ test_superevents_signoff_advocate[NO] _____________________
client = <gracedb_sdk.Client object at 0x106ba3e20>
superevents_create = {'category': 'Test', 'coinc_far': None, 'created': '2020-01-03 13:49:31 UTC', 'em_events': [], ...}
status = 'NO'
@pytest.mark.parametrize('status', ['OK', 'NO'])
def test_superevents_signoff_advocate(client, superevents_create, status):
superevent_id = superevents_create['superevent_id']
client.superevents[superevent_id].labels.create('ADVREQ')
> client.superevents[superevent_id].signoff('ADV', status, comment='foo')
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/tests/test_api.py:396:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/gracedb_sdk/api/event.py:83: in signoff
self.client.post(url, data=data)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:581: in post
return self.request('POST', url, data=data, json=json, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/file.py:72: in request
return super(SessionFileMixin, self).request(
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:533: in request
resp = self.send(prep, **send_kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/sessions.py:653: in send
r = dispatch_hook('response', hooks, r, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/hooks.py:31: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/ligo/requests/errors.py:3: in _hook_raise_errors
response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [403]>
def raise_for_status(self):
"""Raises stored :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
reason = self.reason.decode('iso-8859-1')
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
elif 500 <= self.status_code < 600:
http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gracedb-test.ligo.org/api/superevents/TS110914avv/signoffs/
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8/site-packages/requests/models.py:940: HTTPError
=================== 3 failed, 50 passed in 117.36s (0:01:57) ===================
Edited by Duncan Macleod