aws / eks-anywhere

Run Amazon EKS on your own infrastructure 🚀
https://anywhere.eks.amazonaws.com
Apache License 2.0
1.95k stars 284 forks source link

image-builder exit with error CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier' #5937

Open csantanapr opened 1 year ago

csantanapr commented 1 year ago

What happened: Following instructions to create ubuntu image for baremetal https://anywhere.eks.amazonaws.com/docs/reference/artifacts/#build-bare-metal-node-images

When I run Setup image-builder and group, setup env vars, download image-builder

image-builder build --os ubuntu --hypervisor baremetal --release-channel 1-26

I get error at the end

------------------- 2023-05-30T14:39:49.151+0000 Starting target=deps-raw -------------------
make -C image-builder/images/capi deps-raw
make[1]: Entering directory '/home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi'
hack/ensure-ansible.sh
Starting galaxy collection install process
Process install dependency map
ERROR! Unexpected Exception, this is probably a bug: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'
to see the full traceback, use -vvv
make[1]: *** [Makefile:114: deps-raw] Error 250
make[1]: Leaving directory '/home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi'
make: *** [Makefile:241: deps-raw] Error 2
make: Leaving directory '/home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder'
2023/05/30 10:39:49 Error executing image-builder for raw hypervisor: failed to run command: exit status 2

What you expected to happen:

I want to create image for ubuntu for Intel Nuc, since bottlerocket is not working.

How to reproduce it (as minimally and precisely as possible):

Running

image-builder build --os ubuntu --hypervisor baremetal --release-channel 1-26

Anything else we need to know?:

Environment: Environment

>echo $EKSA_RELEASE_VERSION
v0.15.4
>whoami
image-builder
>pwd
/home/image-builder
>lsb_release  -a
Description:    Ubuntu 22.10
>uname -a
Linux mickey-NUC10i3FNH 5.19.0-42-generic #43-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 18:21:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
csantanapr commented 1 year ago

I edited the script /hack/ensure-ansible.sh to add set +x and -vvv

I get the following output

image-builder@mickey-NUC10i3FNH:~/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi$ ./hack/ensure-ansible.sh
+ [[ -n '' ]]
+ source hack/utils.sh
++ case "${OSTYPE}" in
++ HOSTOS=linux
+++ uname -m
++ _hostarch=x86_64
++ case "${_hostarch}" in
++ HOSTARCH=amd64
+ _version=2.11.5
++ dirname ./hack/ensure-ansible.sh
+ cd ./hack/..
+ export PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_ROOT_USER_ACTION=ignore
+ PIP_DISABLE_PIP_VERSION_CHECK=1
+ PIP_ROOT_USER_ACTION=ignore
+ command -v ansible
+ ansible-galaxy collection install community.general ansible.posix 'ansible.windows:>=1.7.0' community.windows -vvv
ansible-galaxy [core 2.12.4]
  config file = /home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi/ansible.cfg
  configured module search path = ['/home/image-builder/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/image-builder/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-galaxy
  python version = 3.10.7 (main, Mar 10 2023, 10:47:39) [GCC 12.2.0]
  jinja version = 3.0.3
  libyaml = True
Using /home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi/ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
ERROR! Unexpected Exception, this is probably a bug: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-galaxy", line 128, in <module>
    exit_code = cli.run()
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 569, in run
    return context.CLIARGS['func']()
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 86, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 1203, in execute_install
    self._execute_install_collection(
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 1230, in _execute_install_collection
    install_collections(
  File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/__init__.py", line 548, in install_collections
    dependency_map = _resolve_depenency_map(
  File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/__init__.py", line 1364, in _resolve_depenency_map
    return collection_dep_resolver.resolve(
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 147, in _add_to_criteria
    matches = self._p.find_matches(
TypeError: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'
csantanapr commented 1 year ago

Solved the error following instructions from https://github.com/ansible-collections/community.digitalocean/issues/132#issuecomment-1376012650

This is still a problem with a fresh install of Ubuntu 22.10. The below includes the manual downgrade of resolvelib & works (without the manual downgrade, this issue is reproduced):

sudo apt install -y pip
pip install ansible-core
pip install -Iv 'resolvelib<0.6.0'
ansible-galaxy collection install community.general
csantanapr commented 1 year ago

Re-opening as we should document this requirement on ansible