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

Crash : ValueError: too many values to unpack (expected 3) #4563

Open
jlm-gh opened this issue Mar 25, 2025 · 0 comments
Open

Crash : ValueError: too many values to unpack (expected 3) #4563

jlm-gh opened this issue Mar 25, 2025 · 0 comments
Labels
bug new Triage required

Comments

@jlm-gh
Copy link

jlm-gh commented Mar 25, 2025

Maybe a duplicate of #4452

Summary

When using ansible-lint in CI with Docker, the command crashes with ValueError: too many values to unpack (expected 3)

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint --version
ansible-lint 25.1.3 using ansible-core:2.18.3 ansible-compat:25.1.4 ruamel-yaml:0.18.10 ruamel-yaml-clib:0.2.12
ansible --version
ansible [core 2.18.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.13.2 (main, Mar 13 2025, 14:29:07) [GCC 14.2.0] (/usr/bin/python3)
  jinja version = 3.1.5
  libyaml = True
  • ansible installation method:
  • ansible-lint installation method:

using official Debian container debian:testing-slim with the following Dockerfile

FROM debian:testing-slim

COPY .ansible-lint-requirements.yml .
RUN apt -y install ansible-lint ; \
ansible-galaxy install -r .ansible-lint-requirements.yml

with .ansible-lint-requirements.yml as

---
collections:
- ansible.posix
- community.general
- community.docker
- community.mysql
- theforeman.foreman
STEPS TO REPRODUCE

ansible-lint command in our CI container crashes when the following commands are sent

git clone https://our_project.git # done by CI
cd our_project # done by CI
ansible-lint -c .ansible-lint roles/

with

Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 8, in <module>
    sys.exit(_run_cli_entrypoint())
             ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/ansiblelint/__main__.py", line 416, in _run_cli_entrypoint
    sys.exit(main(sys.argv))
             ~~~~^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ansiblelint/__main__.py", line 368, in main
    result = get_matches(rules, options)
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 690, in get_matches
    matches.extend(runner.run())
                   ~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 161, in run
    matches = self._run()
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 273, in _run
    matches.extend(
    ~~~~~~~~~~~~~~^
        self._emit_matches([file for file in files if not file.failed()])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 472, in _emit_matches
    children = self.find_children(lintable)
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 515, in find_children
    for child in self.play_children(
                 ~~~~~~~~~~~~~~~~~~^
        lintable,
        ^^^^^^^^^
    ...<2 lines>...
        playbook_dir,
        ^^^^^^^^^^^^^
    ):
    ^
  File "/usr/lib/python3/dist-packages/ansiblelint/runner.py", line 582, in play_children
    return delegate_map[k](lintable, k, v, parent_type)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ansiblelint/utils.py", line 451, in roles_children
    results.extend(self._look_for_role_files(basedir, role))
                   ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ansiblelint/utils.py", line 516, in _look_for_role_files
    role_path = self._rolepath(basedir, role)
  File "/usr/lib/python3/dist-packages/ansiblelint/utils.py", line 534, in _rolepath
    namespace_name, collection_name, role_name = parse_fqcn(role)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
Desired Behavior

Using the exact same container with the exact same configuration but starting ansible-lint outside the project don't crash (we still have to fix a lot of things)

git clone https://our_project.git
ansible-lint -c our_project/.ansible-lint our_projet/roles/

.....
Failed: 298 failure(s), 36 warning(s) on 1024 files.

Possible security bugs should be reported via email to [email protected]

Actual Behavior

See Step to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
Status: No status
Development

No branches or pull requests

1 participant