aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
290 stars 210 forks source link

Sporadic AVD install error using ansible-galaxy #3797

Closed rrajpuro-anet closed 6 months ago

rrajpuro-anet commented 7 months ago

Issue

Description

IncompleteRead exception from http.client library when installing arista.avd using ansible-galaxy. Command: ansible-galaxy collection install arista.cvp -p ansible_collections Error: http.client.IncompleteRead: IncompleteRead(40424 bytes read, 905069 more expected)

Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/avd/versions/4.7.0/
[WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an unexpected error when getting available versions of collection arista.avd: IncompleteRead(40424
bytes read, 905069 more expected)
ERROR! Unexpected Exception, this is probably a bug: IncompleteRead(40424 bytes read, 905069 more expected)

Might be an issue with http.client library

Environment

Solution

Retry installing multiple times and you might eventually succeed

Stacktrace

Full stack trace for error

(.venv) rahul@inception-rrp:~/evpn-vxlan-examples/labs/evpn/avd_asym_irb$ ansible-galaxy collection install -vvvv arista.avd -p ansible_collections/
ansible-galaxy [core 2.16.5]
  config file = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible.cfg
  configured module search path = ['/home/rahul/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible
  ansible collection location = /home/rahul/evpn-vxlan-examples/labs/evpn/ansible-cvp:/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-avd:/home/rahul/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/bin/ansible-galaxy
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/bin/python3)
  jinja version = 3.1.3
  libyaml = True
Using /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible.cfg as config file
Starting galaxy collection install process
[WARNING]: The specified collections path '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections' is not part of the configured Ansible collections
paths '/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-cvp:/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-
avd:/home/rahul/.ansible/collections:/usr/share/ansible/collections'. The installed collection will not be picked up in an Ansible run, unless within a playbook-adjacent
collections directory.
Loading collection community.mysql from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/community/mysql
Found installed collection community.mysql:3.9.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/community/mysql'
Loading collection amazon.aws from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/amazon/aws
Found installed collection amazon.aws:7.4.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/amazon/aws'
...
...
...
Loading collection netapp.um_info from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/netapp/um_info
Found installed collection netapp.um_info:21.8.1 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/netapp/um_info'
Loading collection ngine_io.exoscale from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/ngine_io/exoscale
Found installed collection ngine_io.exoscale:1.1.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/ngine_io/exoscale'
Process install dependency map
Initial connection to galaxy_server: https://galaxy.ansible.com
Found API version 'v3, pulp-v3, v1' with Galaxy server default (https://galaxy.ansible.com/api/)
Opened /home/rahul/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/avd/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/avd/versions/?limit=100
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/avd/versions/4.7.0/
[WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an unexpected error when getting available versions of collection arista.avd: IncompleteRead(40424
bytes read, 905069 more expected)
ERROR! Unexpected Exception, this is probably a bug: IncompleteRead(40424 bytes read, 905069 more expected)
the full traceback was:

Traceback (most recent call last):
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/cli/__init__.py", line 659, in cli_executor
    exit_code = cli.run()
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 749, in run
    return context.CLIARGS['func']()
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 120, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1409, in execute_install
    self._execute_install_collection(
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1458, in _execute_install_collection
    install_collections(
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 727, in install_collections
    dependency_map = _resolve_depenency_map(
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1837, in _resolve_depenency_map
    return collection_dep_resolver.resolve(
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/resolvelib/resolvers.py", line 229, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/dependency_resolution/providers.py", line 442, in get_dependencies
    req_map = self._api_proxy.get_collection_dependencies(candidate)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 177, in get_collection_dependencies
    get_collection_version_metadata(collection_candidate).
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 162, in get_collection_version_metadata
    raise last_err
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 129, in get_collection_version_metadata
    version_metadata = api.get_collection_version_metadata(
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/api.py", line 137, in wrapped
    return method(self, *args, **kwargs)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/api.py", line 808, in get_collection_version_metadata
    data = self._call_galaxy(n_collection_url, error_context_msg=error_context_msg, cache=True)
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/module_utils/api.py", line 170, in run_function
    return call_retryable_function()
  File "/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible/galaxy/api.py", line 410, in _call_galaxy
    resp_data = to_text(resp.read(), errors='surrogate_or_strict')
  File "/usr/lib/python3.10/http/client.py", line 482, in read
    s = self._safe_read(self.length)
  File "/usr/lib/python3.10/http/client.py", line 633, in _safe_read
    raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(40424 bytes read, 905069 more expected)
(.venv) rahul@inception-rrp:~/evpn-vxlan-examples/labs/evpn/avd_asym_irb$ 

Full stack trace for success

(.venv) rahul@inception-rrp:~/evpn-vxlan-examples/labs/evpn/avd_asym_irb$ ansible-galaxy collection install -vvvv arista.avd -p ansible_collections/
ansible-galaxy [core 2.16.5]
  config file = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible.cfg
  configured module search path = ['/home/rahul/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible
  ansible collection location = /home/rahul/evpn-vxlan-examples/labs/evpn/ansible-cvp:/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-avd:/home/rahul/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/bin/ansible-galaxy
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/bin/python3)
  jinja version = 3.1.3
  libyaml = True
Using /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible.cfg as config file
Starting galaxy collection install process
[WARNING]: The specified collections path '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections' is not part of the configured Ansible collections
paths '/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-cvp:/home/rahul/evpn-vxlan-examples/labs/evpn/ansible-
avd:/home/rahul/.ansible/collections:/usr/share/ansible/collections'. The installed collection will not be picked up in an Ansible run, unless within a playbook-adjacent
collections directory.
Loading collection dellemc.enterprise_sonic from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/dellemc/enterprise_sonic
Found installed collection dellemc.enterprise_sonic:2.4.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/dellemc/enterprise_sonic'
Loading collection purestorage.fusion from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/purestorage/fusion
Found installed collection purestorage.fusion:1.6.1 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/purestorage/fusion'
Loading collection theforeman.foreman from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/theforeman/foreman
Found installed collection theforeman.foreman:3.15.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/theforeman/foreman'
...
...
Loading collection netapp.storagegrid from /home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/netapp/storagegrid
Found installed collection netapp.storagegrid:21.12.0 at '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/.venv/lib/python3.10/site-packages/ansible_collections/netapp/storagegrid'
Process install dependency map
Initial connection to galaxy_server: https://galaxy.ansible.com
Found API version 'v3, pulp-v3, v1' with Galaxy server default (https://galaxy.ansible.com/api/)
Opened /home/rahul/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/avd/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/cvp/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/arista/eos/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/ansible/utils/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/ansible/netcommon/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/ansible/utils/
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/ansible/utils/versions/4.0.0/
Starting collection install process
Server https://galaxy.ansible.com/api/ has not signed arista.avd:4.7.0
Fetching a collection tarball for 'arista.avd:4.7.0' from Ansible Galaxy
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/arista-avd-4.7.0.tar.gz to /home/rahul/.ansible/tmp/ansible-local-7738sshv4jtb/tmpq2bof_4x/arista-avd-4.7.0-dyvqeztq
Validating downloaded file hash acc013a41a881f95d6074b1b04e7d0127c2c65684df1d95180166175fe32c1eb with expected hash acc013a41a881f95d6074b1b04e7d0127c2c65684df1d95180166175fe32c1eb
Collection 'arista.avd:4.7.0' obtained from server default https://galaxy.ansible.com/api/
Installing 'arista.avd:4.7.0' to '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections/arista/avd'
Server https://galaxy.ansible.com/api/ has not signed arista.cvp:3.10.1
Fetching a collection tarball for 'arista.cvp:3.10.1' from Ansible Galaxy
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/arista-cvp-3.10.1.tar.gz to /home/rahul/.ansible/tmp/ansible-local-7738sshv4jtb/tmpq2bof_4x/arista-cvp-3.10.1-4igdfb8c
arista.avd:4.7.0 was installed successfully
Validating downloaded file hash c6b4ca88ee1adc81290aa6b96b1cd0956b8b85d349a341211878ffdcfffc56aa with expected hash c6b4ca88ee1adc81290aa6b96b1cd0956b8b85d349a341211878ffdcfffc56aa
Collection 'arista.cvp:3.10.1' obtained from server default https://galaxy.ansible.com/api/
Installing 'arista.cvp:3.10.1' to '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections/arista/cvp'
arista.cvp:3.10.1 was installed successfully
Server https://galaxy.ansible.com/api/ has not signed arista.eos:8.0.0
Fetching a collection tarball for 'arista.eos:8.0.0' from Ansible Galaxy
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/arista-eos-8.0.0.tar.gz to /home/rahul/.ansible/tmp/ansible-local-7738sshv4jtb/tmpq2bof_4x/arista-eos-8.0.0-flcpi0hb
Validating downloaded file hash 3d945fd9f5799dfd40b21fe08a5802c2db60110fcefe63804eb4ccf61c76188b with expected hash 3d945fd9f5799dfd40b21fe08a5802c2db60110fcefe63804eb4ccf61c76188b
Collection 'arista.eos:8.0.0' obtained from server default https://galaxy.ansible.com/api/
Installing 'arista.eos:8.0.0' to '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections/arista/eos'
arista.eos:8.0.0 was installed successfully
Server https://galaxy.ansible.com/api/ has not signed ansible.netcommon:6.0.0
Fetching a collection tarball for 'ansible.netcommon:6.0.0' from Ansible Galaxy
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-netcommon-6.0.0.tar.gz to /home/rahul/.ansible/tmp/ansible-local-7738sshv4jtb/tmpq2bof_4x/ansible-netcommon-6.0.0-bc4czijf
Validating downloaded file hash 70a4395e1e225593cbbc8ee1bf55df7abb344014dd63e3aa2cb4a24c6b365cd8 with expected hash 70a4395e1e225593cbbc8ee1bf55df7abb344014dd63e3aa2cb4a24c6b365cd8
Collection 'ansible.netcommon:6.0.0' obtained from server default https://galaxy.ansible.com/api/
Installing 'ansible.netcommon:6.0.0' to '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections/ansible/netcommon'
Server https://galaxy.ansible.com/api/ has not signed ansible.utils:4.0.0
Fetching a collection tarball for 'ansible.utils:4.0.0' from Ansible Galaxy
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-4.0.0.tar.gz to /home/rahul/.ansible/tmp/ansible-local-7738sshv4jtb/tmpq2bof_4x/ansible-utils-4.0.0-paafpenu
ansible.netcommon:6.0.0 was installed successfully
Validating downloaded file hash a411e5dac4925d73c7647393564175108a384476e7196ef93e817f71d1744b2b with expected hash a411e5dac4925d73c7647393564175108a384476e7196ef93e817f71d1744b2b
Collection 'ansible.utils:4.0.0' obtained from server default https://galaxy.ansible.com/api/
Installing 'ansible.utils:4.0.0' to '/home/rahul/evpn-vxlan-examples/labs/evpn/avd_asym_irb/ansible_collections/ansible/utils'
ansible.utils:4.0.0 was installed successfully
(.venv) rahul@inception-rrp:~/evpn-vxlan-examples/labs/evpn/avd_asym_irb$ 
ClausHolbechArista commented 6 months ago

We are not able to reproduce this, and since this is not really an issue with the collection itself, we will close this issue here. Please contact Ansible support for this. If I misunderstood something feel free to reopen. Thanks.