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

**URL:** <https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274>\
**Category:** Get Help\
**Tags:** vmware, ansible-builder, ee\
**Created:** [December 21, 2024, 2:04am UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274 "2024-12-21T02:04:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [December 21, 2024, 2:04am UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/1 "2024-12-21T02:04:31Z")

</div>

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:

```auto
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:

```auto
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!

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [December 21, 2024, 3:03am UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/2 "2024-12-21T03:03:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [December 21, 2024, 5:08am UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/3 "2024-12-21T05:08:28Z")

</div>

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.

```auto
 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 🙂  
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](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

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [December 21, 2024, 7:38pm UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/4 "2024-12-21T19:38:55Z")

</div>

I’m also seeing some bug reports that suggest this could be caused by MTU, and for some reason, [github.com](http://github.com) is frequent example.

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [December 25, 2024, 5:50pm UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/5 "2024-12-25T17:50:08Z")

</div>

> [@Wei-Yen\_Tan](#):
>
> `https://github.com/vmware/vsphere-automation-sdk-python.git`

I think this isn’t really necessary anymore. That’s why I’ve [removed this requirement from community.vmware 5.0.0](https://github.com/ansible-collections/community.vmware/pull/2163).

You could try to build your execution environment based on c.v 5.x, or build based on 4.x but with the requirements from 5.x. The latter _should_ work if both your Python and pyVmomi are current.

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [December 25, 2024, 7:22pm UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/6 "2024-12-25T19:22:06Z")

</div>

The module I have used that required this SDK is `vmware_tag_manager`. Is this still the case?

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [December 26, 2024, 10:24am UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/7 "2024-12-26T10:24:03Z")

</div>

[For vSphere APIs vmware-vcenter, pyvmomi and vmware-vapi-common-client will be enough.](https://github.com/vmware/vsphere-automation-sdk-python/issues/38#issuecomment-2206874352)

As far as I understand you still need to install the SDK from Github for NSX, NSX-VMC, VMC or VMC-DraaS stuff. But not for the modules in `community.vmware`.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [December 26, 2024, 6:06pm UTC](https://forum.ansible.com/t/getting-error-when-building-execution-environment-and-installing-vmware-vmware-collection-issue-in-gitlab-runner-container-build/39274/8 "2024-12-26T18:06:57Z")

</div>

thank you for that. will look at retesting this. Was a good learning experience nonetheless
