precice / systemtests

Testing preCICE / solver combinations using Docker
GNU General Public License v3.0
3 stars 4 forks source link

'HTTP Error 403: Forbidden' in push.py #211

Closed Eder-K closed 4 years ago

Eder-K commented 4 years ago

Occasionally, the execution of push.py during a test fails with:

Traceback (most recent call last):
  File "push.py", line 161, in <module>
    log.write(get_travis_job_log(job_id))
  File "push.py", line 45, in get_travis_job_log
    response = urlopen( req ).read().decode()
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/opt/python/3.5.6/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Note that this can usually be resolved by simply restarting the job. Unfortunately, replacing the Travis access token as done for the very similar error #207 does not fix this issue.

Eder-K commented 4 years ago

This issue has been resolved, see this comment. It is likely that this was originally caused by accessing job logs in rapid succession (as can happen when multiple concurrent jobs finish at roughly the same time). Attaching a simple header to the request containing a valid authorization token (see #207) apparently lifts this access restriction.