Getting Error when building execution environment and installing vmware.vmware collection issue in Gitlab-Runner container build

I’m encountering an issue while using ansible-builder to create an execution environment with the registry.access.redhat.com/ubi9/python-312:latest image. I’m adding the vmware.vmware and community.vmware collections. This activity is running in a GitLab Runner container.

To note, I am able to successfully build an execution environment without including these collections. However, when I attempt to install the dependencies for the VMware collections, I run into an error. Here’s the relevant portion of the output:

OpenSSL SSL_connect: Connection reset by peer in connection to github.com:443  
WARNING: Discarding git+https://github.com/vmware/vsphere-automation-sdk-python.git.  
Command errored out with exit status 128:  
git clone --filter=blob:none -q https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-hrn74dxi  
Check the logs for full command output.  
ERROR: Command errored out with exit status 128:  
git clone --filter=blob:none -q https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-hrn74dxi  
Check the logs for full command output.  
WARNING: You are using pip version 21.3.1; however, version 24.3.1 is available.  

I’ve included the following dependencies in my bindep.txt file:

gcc [platform:rpm]  
krb5-devel [platform:rpm]  
python3-devel [platform:rpm]  
sshpass [platform:rpm]  
python3-pip [platform:rpm]  
openssh-clients [platform:rpm]  
git [platform:rpm]  
ca-certificates [platform:rpm]  

I hoped that including git and ca-certificates would address the issue, and I also tried adding them to prepend_base. Unfortunately, this hasn’t resolved the problem.

Interestingly, when I tried building the same execution environment on my VM, it worked perfectly. This suggests that the issue might be related to the container environment, but I haven’t been able to identify the root cause.

Has anyone encountered a similar error before? Any advice on how to resolve this would be greatly appreciated.

Thanks in advance!

Hi Wei,

I vaguely remember having the similar issue but on regular VM that was solved by updating pip. On the other hand, pip is calling git in the background which is failing, not the pip itself, so I’m not so sure it will solve your problem.

My advice is to build a container without vsphere-automation-sdk-python, manually execute interactive shell inside container and then try to manually do a git clone or pip install with higher verbosity and/or logging (-vvv) to see what is happening.

thank you @bvitnik . I was working on this while waiting for a reply . I followed along the same lines like you said.

I did an update on pip and got a more meaningful error message.

 Running command git clone --filter=blob:none --quiet https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-y37ufve6\n  fatal: unable to access 'https://github.com/vmware/vsphere-automation-sdk-python.git/': OpenSSL SSL_connect: Connection reset by peer in connection to github.com:443\n  error: subprocess-exited-with-error\n  \n  × git clone --filter=blob:none --quiet https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-y37ufve6 did not run successfully.\n  │ exit code: 128\n  ╰─> See above for output.\n  \n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: subprocess-exited-with-error\n\n× git clone --filter=blob:none --quiet https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-y37ufve6 did not run successfully.

Or i had to reread to comprehend what it was trying to tell me :slight_smile:
Its having trouble resolving the address.

What i have done is to download the sdk. Take out the community/vmware.vmware option in the requirements.yaml
I have uploaded the sdk to sonatype and done this in the execution environment in append base :

append_base:
- |
RUN $PYCMD -m pip install -U pip &&
$PYCMD -m pip install https://webserver/repository/artifacts/artifacts/python/pypi/vsphere-automation-sdk-python.zip &&
ansible-galaxy collection install community.vmware --no-deps

i think this will solve it. as i am downloading just manually downloading that part of it. I think later i will create a flow that will have ansible update those things but got to get the little things done first and fix the discrepancies. Any thoughts on what I have done? Would installing the sdk externally solve it?

Thank you for your time

I’m also seeing some bug reports that suggest this could be caused by MTU, and for some reason, github.com is frequent example.