ansible-builder icon indicating copy to clipboard operation
ansible-builder copied to clipboard

ansible-builder failing during galaxy steps

Open ebaert95 opened this issue 1 year ago • 1 comments

Hi,

I hope this is the right place to get some help.

I'm using ansible-builder v3. I did try several methods, and every single time, the build is failing during the galaxy phase with:

#33 152.9 Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/microsoft-ad-1.6.0.tar.gz to /root/.ansible/tmp/ansible-local-12kkyl_qo/tmplfu93kfc/microsoft-ad-1.6.0-4nvetrpz #33 ERROR: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path "/usr/share/ansible/collections"" did not complete successfully: exit code: 1

[galaxy 5/5] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install -r requirements.yml --collections-path "/usr/share/ansible/collections": 152.9 ERROR! Failed to download collection tar from 'default' due to the following unforeseen error: <urlopen error [Errno -2] Name or service not known>. <urlopen error [Errno -2] Name or service not known>

I'm running this on Ubuntu 22.04 hosted in Azure. All the previous steps are running just fine.

command I'm running: ansible-builder build --tag=myregistry/custom-ee:1.0.0 --container-runtime=docker --verbosity=3

I attach the execution-environment.yml file, requirements.yml and requirements.txt

Thanks for your help on getting this working.

execution-environment.yml.txt requirements.txt requirements.yml.txt

ebaert95 avatar Jun 14 '24 16:06 ebaert95

Do you have a firewall enabled that might prevent the download? This seems like an issue independent of builder, so I'd try running the ansible-galaxy command manually to attempt to install and see what happens. When I build using these files (which completes successfully, btw), I see that microsoft.ad is the first collection that is being installed, so likely not content related.

Also, see a similar error from the Ansible Forums: https://forum.ansible.com/t/error-failed-to-download-collection-tar-from-default-urlopen-error-errno-111-connection-refused/1540

Shrews avatar Jun 14 '24 17:06 Shrews

I am having a similar issue.

Failed to download collection tar from 'galaxy' due to the following unforeseen error: <urlopen error [Errno -2] Name or service not known>. <urlopen error [Errno -2] Name or service not known>

Within the same container, when I run

curl -Lv https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-9.4.0.tar.gz , the result is

[...]
* Could not resolve host: ansible-galaxy-ng.s3.dualstack.us-east-1.amazonaws.com
* Closing connection 1
curl: (6) Could not resolve host: ansible-galaxy-ng.s3.dualstack.us-east-1.amazonaws.com

However, if I run force ipv4 with curl -4Lv https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-9.4.0.tar.gz, it works.

I'm still working on resolving this myself, but this doesn't appear to be an ansible-builder or ansible-galaxy issue.

mdhowle avatar Sep 27 '24 15:09 mdhowle

The person who opened this issue has deleted their Github account. The issue should probably be closed.

mdhowle avatar Sep 27 '24 15:09 mdhowle