Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wasalm opened this issue Jun 29, 2023 · 3 comments · May be fixed by codalab/competitions-v1-compute-worker#26

Comments

@wasalm
Copy link

wasalm commented Jun 29, 2023

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
Copy link
Author

wasalm commented Jun 29, 2023

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 added a commit to wasalm/competitions-v1-compute-worker that referenced this issue Jun 29, 2023
@wasalm
Copy link
Author

wasalm commented Jun 29, 2023

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

@Didayolo
Copy link
Member

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

We'll look into it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants