ansible / galaxy

Legacy Galaxy still available as read-only on https://old-galaxy.ansible.com - looking for the new galaxy -> https://github.com/ansible/galaxy_ng
Apache License 2.0
854 stars 328 forks source link

Time to time https://galaxy.ansible.com responds 500 code #2954

Open dmitryrode opened 2 years ago

dmitryrode commented 2 years ago

Bug Report

SUMMARY

Time to time https://galaxy.ansible.com responds 500 code, when I am try to run ansible-galaxy install.

STEPS TO REPRODUCE

ansible-galaxy install -r requirements.yml

cat requirements.yml
collections:
  # Install a collection from Ansible Galaxy.
  - name: community.general
    version: 4.1.0
    source: https://galaxy.ansible.com
EXPECTED RESULTS
Downloading https://galaxy.ansible.com/download/community-general-4.1.0.tar.gz to /.ansible/tmp/ansible-local-63565ah3koefe/tmpbvam948_/community-general-4.1.0-ymiv5b9z
Installing 'community.general:4.1.0' to 'ansible_collections/community/general'
 community.general:4.1.0 was installed successfully
Downloading https://galaxy.ansible.com/download/ansible-posix-1.3.0.tar.gz to /.ansible/tmp/ansible-local-63565ah3koefe/tmpbvam948_/ansible-posix-1.3.0-07rf0ktk
Installing 'ansible.posix:1.3.0' to 'ansible_collections/ansible/posix'
ansible.posix:1.3.0 was installed successfully
Downloading https://galaxy.ansible.com/download/openstack-cloud-1.5.3.tar.gz to /.ansible/tmp/ansible-local-63565ah3koefe/tmpbvam948_/openstack-cloud-1.5.3-dftxevgk
Installing 'openstack.cloud:1.5.3' to 'ansible_collections/openstack/cloud'
ACTUAL RESULTS

ERROR! Error when finding available api versions from default (https://galaxy.ansible.com/) (HTTP Code: 500, Message: Internal Server Error)

rhysmeister commented 2 years ago

I'm seeing this fairly often too. Also timeouts. Examples...

ERROR! Error when finding available api versions from default (https://galaxy.ansible.com/) (HTTP Code: 500, Message: Internal Server Error)
Starting galaxy collection install process
Process install dependency map
Error: Final attempt failed. Child_process exited with error code 1
Warning: : Skipping Galaxy server [https://galaxy.ansible.com/api/.](https://galaxy.ansible.com/api/) Got an
unexpected error when getting available versions of collection ansible.posix:
Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/v2/collections/ansible/posix/': The read
operation timed out
ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/ansible/posix/': The read operation timed out
Starting galaxy collection install process
Process install dependency map
Error: Final attempt failed. Child_process exited with error code 1

We saw this sometime last year, I'm unable tio locate the issue atm, but that was due to someone continually scraping the galaxy site.

v4dkou commented 2 years ago

I have this issue too with various error messages

Here are some examples from our failed CI builds:

+ ansible-galaxy install -r ./prerequisites/requirements.yml
Starting galaxy role install process
- downloading role 'docker-systemd-service', owned by mhutter
- downloading role from https://github.com/mhutter/ansible-docker-systemd-service/archive/v2.7.0.tar.gz
- extracting mhutter.docker-systemd-service to /root/.ansible/roles/mhutter.docker-systemd-service
- mhutter.docker-systemd-service (v2.7.0) was installed successfully
- downloading role 'docker', owned by geerlingguy
[WARNING]: - geerlingguy.docker was NOT installed successfully: None (HTTP
Code: 502, Message: Bad Gateway)
+ ansible-galaxy install -r ./prerequisites/requirements.yml
Starting galaxy role install process
- downloading role 'docker-systemd-service', owned by mhutter
[WARNING]: - mhutter.docker-systemd-service was NOT installed successfully:
Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/v1/roles/?owner__username=mhutter&name=docker-
systemd-service': <urlopen error EOF occurred in violation of protocol
(_ssl.c:1131)>

And here's one from when I tried switching from requirements.yml to a direct role installation.

+ ansible-galaxy install mhutter.docker-systemd-service
Starting galaxy role install process
[WARNING]: - mhutter.docker-systemd-service was NOT installed successfully:
Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/': <urlopen error EOF occurred in violation of
protocol (_ssl.c:1131)>

If there was a way to host your own Ansible Galaxy mirror, this could be solved easily for enterprise environments, however this issue leads to nowhere https://github.com/ansible/galaxy-issues/issues/48

Also, some people keep commenting in #2302 about this problem