codalab-competitions icon indicating copy to clipboard operation
codalab-competitions copied to clipboard

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

Open wasalm opened this issue 2 years ago • 3 comments

I try to self host codalab competitions using minion. I have everything working except that submissions are failed due to the following error:

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

My hosts is behind a proxy and is certified by letsencrypt.

I can temporary fix it by changing worker.py (inside the competitions-v1-compute-worker container) and add the line verify=False to the put_blob function. That is,

def put_blob(url, file_path):
    logger.info("Putting blob %s in %s" % (file_path, url))
    requests.put(
        url,
        data=open(file_path, 'rb'),
        headers={
            'x-ms-blob-type': 'BlockBlob',
            'x-ms-version': '2018-03-28',
        },
        verify=False
    )

But this of course is a temporary fix. Can you look into this? Thanks.

wasalm avatar Jun 29 '23 11:06 wasalm

This is the full Trackback

Traceback (most recent call last):
  File "/worker/worker.py", line 708, in run
    put_blob(stdout_url, stdout_file)
  File "/worker/worker.py", line 214, in put_blob
    'x-ms-version': '2018-03-28',
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 99, in put
    return request('put', url, data=data, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 335, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 438, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 324, in send
    raise ConnectionError(sockerr)
ConnectionError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)

wasalm avatar Jun 29 '23 11:06 wasalm

Turns out that the issue is that requests is outdated. Update to at least 2.27.0

wasalm avatar Jun 29 '23 11:06 wasalm

Thank you for reporting this issue and for your pull request.

We'll look into it soon.

Didayolo avatar Jun 29 '23 11:06 Didayolo