Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/ansible/ansible/pull/81780 breaks installation of Mayeu.RabbitMQ 1.4.0 #82073

Closed
1 task done
dmick opened this issue Oct 25, 2023 · 4 comments
Closed
1 task done
Labels
affects_2.15 bug This issue/PR relates to a bug.

Comments

@dmick
Copy link

dmick commented Oct 25, 2023

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

$ ansible --version
ansible [core 2.15.5]
  config file = /home/dmick/src/ceph/ceph-build/ansible/ansible.cfg
  configured module search path = ['/home/dmick/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/dmick/src/ceph/ceph-build/ansible/v/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/dmick/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/dmick/src/ceph/ceph-build/ansible/v/bin/ansible
  python version = 3.9.13 (main, Jun 24 2022, 15:32:51) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)] (/home/dmick/src/ceph/ceph-build/ansible/v/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /home/dmick/src/ceph/ceph-build/ansible/ansible.cfg
DEFAULT_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) = False

CONNECTION:
==========

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.RabbitMQ
ERROR! 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
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. affects_2.15 labels Oct 25, 2023
@ansibot
Copy link
Contributor

ansibot commented Oct 25, 2023

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

@Akasurde
Copy link
Member

This is a duplicate of #81965, possible fix in #82052.

@Akasurde Akasurde closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2023
dmick pushed a commit to dmick/ceph-build that referenced this issue Oct 25, 2023
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>
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Oct 25, 2023
@dmick
Copy link
Author

dmick commented Oct 25, 2023

apologies for the duplicate. I searched for the error, but apparently badly.

@Akasurde
Copy link
Member

@dmick No worries. Thanks for reporting this issue.

@ansible ansible locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.15 bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants