Skip to content
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

Error when trying community.windows modules: urllib3 package missing #6

Open
m-hoskin-unisa opened this issue May 26, 2022 · 3 comments

Comments

@m-hoskin-unisa
Copy link

Pulled down the AIO repo and ran ansible-builder without any modifications which successfully created a docker image. Was able to import the image into AWX and run as an Execution Environment, however when trying to run a test playbook using a community.windows module it failed with this error:
"winrm or requests is not installed: No module named 'urllib3.packages.six'"

I can see from the build output that the package was detected as already present:
Requirement already satisfied: urllib3>=1.15 in /usr/lib/python3.8/site-packages (from -r /tmp/src/requirements.txt (line 28)) (1.25.7)

Ansible-builder was run with Python 3.8.11. Does the requirements.txt need to be more explicit when referencing the packages?

@tomoliveri
Copy link
Owner

Looks like we'll need to add 'six' to the requirements.txt
Testing atm...

@m-hoskin-unisa
Copy link
Author

I was able to find other references to the same error around the place, from the sounds of it some ditros (such as CentOS) seem to be linking rather than actually installing packages which is causing problems. I've been able to work around the issue by editing the Dockerfile that ansible-builder produces to tell it to uninstall and then reinstall the specific package:

So it was:

FROM $EE_BASE_IMAGE
USER root
RUN pip3 install --upgrade pip setuptools

And I've set it to:

FROM $EE_BASE_IMAGE
USER root
RUN pip3 install --upgrade pip setuptools \
  && pip3 uninstall urllib3 -y \
  && pip3 install --no-cache-dir -U urllib3==1.25.7

Then compiled the image using the command that ansible-builder uses:

docker build -f context/Dockerfile -t ansible_custom_ee

Not sure of the best way of adding this into the AIO config, I'm not too familiar with the ansible-builder tool.

@JB-Encrypt
Copy link

@tomoliveri did you manage to find a fix for this issue? i'm running into the same issue when trying to utilize the Netbox module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants