ansible-collections / community.digitalocean

This Ansible collection contains modules for assisting in the automation of the DigitalOcean cloud.
https://galaxy.ansible.com/community/digitalocean/
GNU General Public License v3.0
141 stars 57 forks source link

find_matches() got an unexpected keyword argument 'identifier' #132

Closed lousyd closed 3 years ago

lousyd commented 3 years ago
SUMMARY

Cannot install collection. find_matches() got an unexpected keyword argument 'identifier'.

ISSUE TYPE
COMPONENT NAME

community.digitalocean

ANSIBLE VERSION
ansible [core 2.11.1] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/lousyd/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lousyd/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /etc/ansible/collections:/home/lousyd/.local/share/ansible/collections:/usr/share/ansible/collections
  executable location = /home/lousyd/.local/bin/ansible
  python version = 3.9.6 (default, Jul 16 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
  jinja version = 3.0.1
  libyaml = True
COLLECTION VERSION
# /home/lousyd/.local/lib/python3.9/site-packages/ansible_collections
Collection             Version
---------------------- -------
community.digitalocean 1.1.1
CONFIGURATION
ANSIBLE_NOCOWS(/etc/ansible/ansible.cfg) = True
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/etc/ansible/collections', '/home/lousyd/.local/share/ansible/collections', '/usr/share/ansible/collections']
DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = implicit
DEFAULT_GATHER_SUBSET(/etc/ansible/ansible.cfg) = ['all', 'network', 'hardware', 'virtual', '!facter', '!ohai']
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_PRIVATE_KEY_FILE(/etc/ansible/ansible.cfg) = /etc/ansible/CB-Prod.pem
DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/roles', '/usr/share/ansible/roles']
DEFAULT_SELINUX_SPECIAL_FS(/etc/ansible/ansible.cfg) = ['nfs', 'vboxsf', 'fuse', 'ramfs', '9p', 'vfat']
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = default
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = /usr/bin/pass
INJECT_FACTS_AS_VARS(/etc/ansible/ansible.cfg) = True
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['host_list', 'yaml', 'script', 'gcp_compute']
LOCALHOST_WARNING(/etc/ansible/ansible.cfg) = False
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
SHOW_CUSTOM_STATS(/etc/ansible/ansible.cfg) = True
TRANSFORM_INVALID_GROUP_CHARS(/etc/ansible/ansible.cfg) = silently
OS / ENVIRONMENT

Fedora Linux 34

STEPS TO REPRODUCE
ansible-galaxy collection install community.digitalocean -vvvv
EXPECTED RESULTS

Expected success.

ACTUAL RESULTS
❯ ansible-galaxy collection install community.digitalocean -vvvv
ansible-galaxy [core 2.11.1] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/lousyd/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lousyd/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /etc/ansible/collections:/home/lousyd/.local/share/ansible/collections:/usr/share/ansible/collections
  executable location = /home/lousyd/.local/bin/ansible-galaxy
  python version = 3.9.6 (default, Jul 16 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
  jinja version = 3.0.1
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
ERROR! Unexpected Exception, this is probably a bug: find_matches() got an unexpected keyword argument 'identifier'
the full traceback was:

Traceback (most recent call last):
  File "/home/lousyd/.local/bin/ansible-galaxy", line 135, in <module>
    exit_code = cli.run()
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 552, in run
    return context.CLIARGS['func']()
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 75, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1186, in execute_install
    self._execute_install_collection(
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1213, in _execute_install_collection
    install_collections(
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/galaxy/collection/__init__.py", line 511, in install_collections
    dependency_map = _resolve_depenency_map(
  File "/home/lousyd/.local/lib/python3.9/site-packages/ansible/galaxy/collection/__init__.py", line 1328, in _resolve_depenency_map
    return collection_dep_resolver.resolve(
  File "/home/lousyd/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 473, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/lousyd/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 341, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/home/lousyd/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 147, in _merge_into_criterion
    matches = self._p.find_matches(
TypeError: find_matches() got an unexpected keyword argument 'identifier'
tadeboro commented 3 years ago

This does not look like an error related to the DO collection. Are you only having problems with this collection?

lousyd commented 3 years ago

Good lead. I am having problems with other collections. This must be a problem with...... I don't know. ansible-galaxy itself?

tadeboro commented 3 years ago

This sounds like a problem with ansible itself (https://github.com/ansible/ansible), so may want to file an issue there. Also, you should visit the #ansible channel on libera IRC network where you can get some real-time help from other community members (https://web.libera.chat/).

lousyd commented 3 years ago

Thank you.

codeguy commented 3 years ago

@lousyd Did you discover a solution? Just ran into this same issue this morning. Latest Ansible installed via pip on ubuntu 20.04.

codeguy commented 3 years ago

Just found the issue for any other folks that stumble upon this thread. Latest Ansible requires a specific version of resolvelib (<0.6.0 to be exact). Fix with this command:

sudo -H pip install -Iv 'resolvelib<0.6.0'

Details here:

https://bugs.gentoo.org/795933

tadeboro commented 3 years ago

Ansible devs did properly bound the resolvelib version in https://github.com/ansible/ansible/blob/devel/requirements.txt, which should make sure the right version of the resolvelib is installed. @codeguy Did you install it into a fresh venv or did you install it globally (which is probably a bad idea)?

lousyd commented 3 years ago

I don't recall exactly what it was I did to resolve the issue, but I do see a python3 -m pip install --upgrade ansible in my bash history, just before my last attempt at installing the collection. And it is successfully installed now. So... maybe that did it? I don't recall for sure. Sorry.

bearcodi commented 2 years ago

@codeguy solution worked for me, definitely seems to be more of an issue with ansible-galaxy, was trying to use the community.docker extension.

My OS:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy
Python:     3.10.4
Ansible:    2.12.5
rdvansloten commented 2 years ago

@codeguy solved this for me too. It does require the resolvlib to be downgraded to 0.5.4. I had 0.8 installed, which caused this bug.

DanVanAtta commented 1 year ago

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

I opened an issue with ansible.

dannyman commented 1 year ago

@DanVanAtta, if you could be so kind as to share a link to the issue you opened with Ansible? Thanks!

Valath commented 1 year ago

I fixed it with the below commands.

sudo apt install -y pip;
pip install -Iv 'resolvelib<0.6.0';
ansible-galaxy collection install community.windows;
MaxiReglisse commented 8 months ago

Same thing in my case to install checkmk.general.

root@nfs1-server:~# ansible-galaxy collection install checkmk.general
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'

Installing resolvelib solved the problem!

pip install -Iv 'resolvelib<0.6.0';

OS/Environment

Ubuntu 22.04.3 LTS
ansible [core 2.12.9]
python version = 3.10.12
jinja version = 3.0.3
oscarparzival commented 7 months ago

Encountered the same problem when trying to install checkmk.general, just like @MaxiReglisse. ansible-galaxy collection install checkmk.general, which failed because of for example: TypeError: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'.

I first used apt install ansible-core, however, after removing it and installing apt install ansible, the installation of checkmk.general succeded.

Attethm commented 2 months ago

Thanks !