You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR! Unexpected Exception, this is probably a bug: join() missing 1 required positional argument: 'a'
I've tracked this down to https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy/role.py#L425 which was modified recently in #81780. The issue is that Mayeu.rabbitmq has a symlink in the tar file "vagrant/roles/rabbitmq => ../../", which does not reference outside the tar contents, but the code in role.py drops both instances of '..', and then when it attempts to join the parts at line 425, it fails, because n_final_parts is an empty list.
Merely adding a "if len(n_final_parts) == 0" resolves that issue, but there are other cases where len(n_final_parts) == 1, and the join also fails in that case (which can be handled by another case "if len(n_final_parts) == 1: path = n_final_parts[0]".
I'm not certain of the correctness of the above fixes; I don't really understand what the checks for '..' are about.
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t allCONFIG_FILE() = /home/dmick/src/ceph/ceph-build/ansible/ansible.cfgDEFAULT_CALLBACK_PLUGIN_PATH(/home/dmick/src/ceph/ceph-build/ansible/ansible.cfg) = ['/home/dmick/src/ceph/ceph-build/ansible/callbacks']DEFAULT_HOST_LIST(env: ANSIBLE_INVENTORY) = ['/home/dmick/src/ceph/ceph-sepia-secrets/ansible/inventory/sepia']RETRY_FILES_ENABLED(/home/dmick/src/ceph/ceph-build/ansible/ansible.cfg) = FalseCONNECTION:==========ssh:___pipelining(/home/dmick/src/ceph/ceph-build/ansible/ansible.cfg) = True
OS / Environment
PRETTY_NAME="CentOS Stream 8"
Steps to Reproduce
git clone https://github.com/ceph/ceph-build
cd ceph-build/ansible
python3 -mvenv v
. v/bin/activate
ansible-galaxy role install -r requirements/sensu-requirements.yml -p roles --force
Expected Results
Expected requirements in requirements/sensu-requirements.yml to install; instead get error messages and failure
Actual Results
(NOTE: it's a little odd in that both requested roles have a '..' in their installation, but the warning is innocuous for the first role (Mayeu.sensu) and apparently suppresses the warning for the second role (Mayeu.RabbitMQ))Starting galaxy role install process- extracting Mayeu.sensu to /home/dmick/src/ceph/ceph-build/ansible/roles/Mayeu.sensu[WARNING]: Illegal filename '..': '..' is not allowed- Mayeu.sensu (remotes/origin/plugin-gem-install) was installed successfully- downloading role 'RabbitMQ', owned by Mayeu- downloading role from https://github.com/Mayeu/ansible-playbook-rabbitmq/archive/1.4.0.tar.gz- extracting Mayeu.RabbitMQ to /home/dmick/src/ceph/ceph-build/ansible/roles/Mayeu.RabbitMQERROR! Unexpected Exception, this is probably a bug: join() missing 1 required positional argument: 'a'to see the full traceback, use -vvv
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
ansible 8.5.0 includes a change to ansible-galaxy that breaks
the installation of sensu and rabbitmq:
ansible/ansible#82073
Work around that by pinning ansible to 8.4.0
Fixes: https://tracker.ceph.com/issues/63223
Signed-off-by: Dan Mick <dmick@redhat.com>
Summary
Long-used installation code to install sensu and rabbitmq using https://github.com/andrewschoen/ansible-playbook-sensu has recently started to break, with message
ERROR! Unexpected Exception, this is probably a bug: join() missing 1 required positional argument: 'a'
I've tracked this down to https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy/role.py#L425 which was modified recently in #81780. The issue is that Mayeu.rabbitmq has a symlink in the tar file "vagrant/roles/rabbitmq => ../../", which does not reference outside the tar contents, but the code in role.py drops both instances of '..', and then when it attempts to join the parts at line 425, it fails, because n_final_parts is an empty list.
Merely adding a "if len(n_final_parts) == 0" resolves that issue, but there are other cases where len(n_final_parts) == 1, and the join also fails in that case (which can be handled by another case "if len(n_final_parts) == 1: path = n_final_parts[0]".
I'm not certain of the correctness of the above fixes; I don't really understand what the checks for '..' are about.
Issue Type
Bug Report
Component Name
ansible-galaxy
Ansible Version
Configuration
OS / Environment
PRETTY_NAME="CentOS Stream 8"
Steps to Reproduce
git clone https://github.com/ceph/ceph-build
cd ceph-build/ansible
python3 -mvenv v
. v/bin/activate
ansible-galaxy role install -r requirements/sensu-requirements.yml -p roles --force
Expected Results
Expected requirements in requirements/sensu-requirements.yml to install; instead get error messages and failure
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: