ansible / ansible-builder

An Ansible execution environment builder
Other
287 stars 93 forks source link

ansible-builder failing during galaxy steps #682

Open ghost opened 2 months ago

ghost commented 2 months ago

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

Shrews commented 2 months ago

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