Skip to content

[travis-ci] debugging ci failures on travis #2387

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

joerick
Copy link
Contributor

@joerick joerick commented May 10, 2025

It seems there's something in the GraalPy build that isn't happy on a Travis windows machine - example

I've seen the same error on Cirrus too.

@joerick joerick added the CI: GraalPy Run the integration test suite with GraalPy included label May 10, 2025
@joerick joerick force-pushed the travis-ci-debugging branch 2 times, most recently from ce92c7f to 337095e Compare May 15, 2025 12:16
@joerick
Copy link
Contributor Author

joerick commented May 16, 2025

A new error appears!

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pathlib
cibuildwheel: error: Command python -c "import os, pathlib, sys; pathlib.Path('./text_info.txt').write_text('sample text '+os.environ.get('TEST_VAL', ''))" && python -c "import pathlib, sys; pathlib.Path('./python_prefix.txt').write_text(sys.prefix)" failed with code 1. 

I guess that in before_all python is referring to Python 2?

@joerick joerick marked this pull request as ready for review May 18, 2025 14:51
@joerick
Copy link
Contributor Author

joerick commented May 18, 2025

Pretty sure this is done now. The latest Travis failure was a timeout, I've retried it.

@joerick
Copy link
Contributor Author

joerick commented May 18, 2025

The timeout was repeatable, so I've disabled PyPy and GraalPy tests on the Travis windows runner. It's a shame, because it did find a bug (newlines in env var values causing issues, also fixed in this PR), but I don't know of another way around it.

@henryiii henryiii force-pushed the travis-ci-debugging branch from 7d8d736 to 59020a5 Compare May 21, 2025 04:28
@joerick
Copy link
Contributor Author

joerick commented May 21, 2025

This looks like a success, but the latest run of this PR on travis actually failed-

https://app.travis-ci.com/github/pypa/cibuildwheel/jobs/632928641#L895

It fails with the new test_ssl.py-

import textwrap

from . import test_projects, utils

project_with_ssl_tests = test_projects.new_c_project(
    setup_py_add=textwrap.dedent(
        r"""
        import ssl

        from urllib.request import urlopen

        context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
        # badssl.com is a HTTPS test server that can be used to test SSL connections
        data = urlopen("https://tls-v1-2.badssl.com", context=context)
        data = urlopen("https://tls-v1-2.badssl.com")
        """
    )
)


def test(tmp_path):
    # this test checks that SSL is working in the build environment using
    # some checks in setup.py.
    project_dir = tmp_path / "project"
    project_with_ssl_tests.generate(project_dir)

    actual_wheels = utils.cibuildwheel_run(project_dir)

    expected_wheels = utils.expected_wheels("spam", "0.1.0")
    assert set(actual_wheels) == set(expected_wheels)

the error is:

Traceback (most recent call last):
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 1007, in _send_output
    self.send(msg)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 947, in send
    self.connect()
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\http\client.py", line 1421, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\travis\AppData\Local\Temp\cibw-run-w0vuxe78\cp38-win32\build\venv\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
    main()
  File "C:\Users\travis\AppData\Local\Temp\cibw-run-w0vuxe78\cp38-win32\build\venv\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
  File "C:\Users\travis\AppData\Local\Temp\cibw-run-w0vuxe78\cp38-win32\build\venv\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
    return hook(config_settings)
  File "C:\Users\travis\AppData\Local\Temp\build-env-xzdytsc7\lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
  File "C:\Users\travis\AppData\Local\Temp\build-env-xzdytsc7\lib\site-packages\setuptools\build_meta.py", line 303, in _get_build_requires
    self.run_setup()
  File "C:\Users\travis\AppData\Local\Temp\build-env-xzdytsc7\lib\site-packages\setuptools\build_meta.py", line 521, in run_setup
    super().run_setup(setup_script=setup_script)
  File "C:\Users\travis\AppData\Local\Temp\build-env-xzdytsc7\lib\site-packages\setuptools\build_meta.py", line 319, in run_setup
    exec(code, locals())
  File "<string>", line 15, in <module>
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Users\travis\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\pythonx86.3.8.10\tools\lib\urllib\request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)>
cibuildwheel: error: Command ['C:\\Users\\travis\\AppData\\Local\\Temp\\cibw-run-w0vuxe78\\cp38-win32\\build\\venv\\Scripts\\python.EXE', '-m', 'build', 'C:\\Users\\travis\\AppData\\Local\\Temp\\pytest-of-travis\\pytest-2\\popen-gw1\\test5\\project', '--wheel', '--outdir=C:\\Users\\travis\\AppData\\Local\\Temp\\cibw-run-w0vuxe78\\cp38-win32\\built_wheel'] failed with code 1. 

Ideas for how to fix are welcome. I don't understand why either invocations of urlopen would fail.

@mayeut
Copy link
Member

mayeut commented May 25, 2025

urlopen doesn't use certifi.
The system certificates are probably out of date on Travis.
I'll try to check if we can force an update to see if that's the case.

@mayeut mayeut marked this pull request as draft May 25, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: GraalPy Run the integration test suite with GraalPy included
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants