You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recent updates to 3.9 and 3.7 images led to issue with SSL module during pip deps installation #787
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
[1033][2023-01-19 09:56:22] Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
3.9.15 and 3.7.15 images aren't affected
Reacted by Oleksandr Hrab, Shulman Evgeny, Viktor Danyliuk, Alberto Klocker, Tatulian Arutiun and Danil Akhtarov
changed the title [-]Recent updated to 3.9 and 3.7 images led to issue with SSL module during pip deps installation[/-][+]Recent updates to 3.9 and 3.7 images led to issue with SSL module during pip deps installation[/+]on Jan 19, 2023
To be more specific, the issue seems to be related to our custom kaniko image. When building with docker build .. no issue was detected.
The issue is definitely related to some recent changes in python:3.9 and python:3.7 images, until yesterday everything worked as expected. Alpine images work fine even after the recent changes.
Hmm, that's weird -- all that's changed recently is #785, which shouldn't affect TLS, so I wonder what Kaniko is doing that's causing that to misbehave? 🤔 (unfortunately I don't actually know very much about Kaniko 🙈)
I have no deep understanding on how kaniko works but I will try to explain with my words:
kaniko is based on scratch image by default, so it allows to build any images with any FROM statement.
after we created custom kaniko image, we had issues building images that are not on the same "base" as our custom kaniko image
I guess some path changes -rpath='$\$ORIGIN/../lib' lead to some conflicts between our custom kaniko image and the new python:3.9 image, but not sure why python:3.9-alpine works fine
side effect looks like a missing library for SSL. Maybe other libs are missing too.
For anyone else who encounter such issue with custom kaniko - you could use previous python:3.9.15 image.
echo"FROM gcr.io/kaniko-project/executor:v1.8.1-debug as kanikoFROM docker:20.10.6# Add kaniko binaryCOPY --from=kaniko /kaniko/executor /kaniko/# we install a lot of additional tools&packages but the issue is reproduced without them"> Dockerfile.custom-kaniko
docker build -t custom-kaniko - < Dockerfile.custom-kaniko
# this works with python:3.9.15
docker run --rm -it custom-kaniko sh -c 'echo "FROM python:3.9.15" > Dockerfile.test-image; echo "RUN pip install -U pip" >> Dockerfile.test-image; /kaniko/executor --dockerfile Dockerfile.test-image --no-push;'# this fails with python:3.9# Could not fetch URL https://pypi.org/simple/pip/:# There was a problem confirming the ssl certificate:# HTTPSConnectionPool(host='pypi.org', port=443):# Max retries exceeded with url: /simple/pip/ (# Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")# ) - skipping
docker run --rm -it custom-kaniko sh -c 'echo "FROM python:3.9" > Dockerfile.test-image; echo "RUN pip install -U pip" >> Dockerfile.test-image; /kaniko/executor --dockerfile Dockerfile.test-image --no-push;'
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")'
Can build with Docker builder fine but pip and python complain about SSL modules under Kaniko.
Added the following to the Dockerfile to try and get more info on the state of ssl module. RUN python -c "import ssl; print(ssl.get_default_verify_paths())"
With the following output when running in Kaniko.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: /usr/local/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu.so: undefined symbol: COMP_get_type, version OPENSSL_1_1_0
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
Activity
[-]Recent updated to 3.9 and 3.7 images led to issue with SSL module during pip deps installation[/-][+]Recent updates to 3.9 and 3.7 images led to issue with SSL module during pip deps installation[/+]POD666 commentedon Jan 19, 2023
To be more specific, the issue seems to be related to our custom kaniko image. When building with
docker build ..no issue was detected.The issue is definitely related to some recent changes in python:3.9 and python:3.7 images, until yesterday everything worked as expected. Alpine images work fine even after the recent changes.
tianon commentedon Jan 19, 2023
Is there a particular reason you're building the image yourself instead of using the pre-built images? (the pre-built images work fine, right?)
CarpathianUA commentedon Jan 19, 2023
@tianon We use pre-built images like
python:3.9as a base layer for our custom imagsetianon commentedon Jan 19, 2023
Hmm, that's weird -- all that's changed recently is #785, which shouldn't affect TLS, so I wonder what Kaniko is doing that's causing that to misbehave? 🤔 (unfortunately I don't actually know very much about Kaniko 🙈)
POD666 commentedon Jan 19, 2023
I have no deep understanding on how kaniko works but I will try to explain with my words:
scratchimage by default, so it allows to build any images with any FROM statement.-rpath='$\$ORIGIN/../lib'lead to some conflicts between our custom kaniko image and the new python:3.9 image, but not sure why python:3.9-alpine works fineFor anyone else who encounter such issue with custom kaniko - you could use previous python:3.9.15 image.
tianon commentedon Jan 19, 2023
Do you have a small reproducer? @yosifkit is playing with
kanikonow andpip install xxxis working fine for him 😅POD666 commentedon Jan 20, 2023
Yes, here is a script to reproduce:
albertok commentedon Jan 20, 2023
Started having the same issue yesterday as well.
Can build with Docker builder fine but pip and python complain about SSL modules under Kaniko.
Added the following to the Dockerfile to try and get more info on the state of ssl module.
RUN python -c "import ssl; print(ssl.get_default_verify_paths())"With the following output when running in Kaniko.
Issue seems to coincide with 2592ad8
yosifkit commentedon Jan 20, 2023