eddyxu / cpp-coveralls

Upload gcov results to coveralls.io
Apache License 2.0
282 stars 74 forks source link

Ubuntu artful: AttributeError: 'module' object has no attribute 'X509_up_ref' #122

Open bassosimone opened 6 years ago

bassosimone commented 6 years ago

Hello hello hello! For measurement-kit, we use a travis-ci based docker based build script where we submit coverage using coveralls.

I recently authored a change to switch our docker containers from from yakkety to artful (see https://github.com/measurement-kit/measurement-kit/pull/1552). That change broke cpp-coveralls as follows:

[...]

From cffi callback <function _verify_callback at 0x7fc1f03e05f0>:
Traceback (most recent call last):
  File "/root/.local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 313, in wrapper
    _lib.X509_up_ref(x509)
AttributeError: 'module' object has no attribute 'X509_up_ref'
Traceback (most recent call last):
  File "/root/.local/bin/coveralls", line 11, in <module>
    sys.exit(run())
  File "/root/.local/lib/python2.7/site-packages/cpp_coveralls/__init__.py", line 106, in run
    return report.post_report(cov_report)
  File "/root/.local/lib/python2.7/site-packages/cpp_coveralls/report.py", line 12, in post_report
    response = requests.post(URL, files={'json_file': json.dumps(coverage)})
  File "/root/.local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/root/.local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='coveralls.io', port=443): Max retries exceeded with url: /api/v1/jobs (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))

My interpretation of the above stack trace is that the error happens well below the level where cpp-coveralls is actually involved. It seems to me that the handshake is ongoing and the certificate verify callback is called but actually does not find a symbol that it is expecting.

FWIW, this bug is gone in bionic.

@eddyxu do you have any suggestion / insight re: how to avoid this issue? Does my analysis make sense and it's correct to say that this is not a cpp-coveralls issue? Does it make sense to keep this issue open anyway if somebody else experiences this issue?

Thanks for working on cpp-coveralls! :)