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

Homebrew: "KeyError: 'pop from an empty set'" for tap #9641

Open
1 task done
cdayjr opened this issue Jan 27, 2025 · 7 comments · May be fixed by #9665
Open
1 task done

Homebrew: "KeyError: 'pop from an empty set'" for tap #9641

cdayjr opened this issue Jan 27, 2025 · 7 comments · May be fixed by #9665
Labels
bug This issue/PR relates to a bug callback callback plugin module module plugins plugin (any type) traceback

Comments

@cdayjr
Copy link

cdayjr commented Jan 27, 2025

Summary

When I try and installTheZoraiz/ascii-image-converter/ascii-image-converter with or without tap prefix, I get a "KeyError: 'pop from an empty set'" error.

Before 10.3.0 I was able to install it without the tap prefix.

Before 10.2.0 I was able to install it with the full path.

Seems related to #9546, #9533, #9255, and #9240

Issue Type

Bug Report

Component Name

plugins/modules/homebrew.py

Ansible Version

ansible [core 2.18.1]
  config file = None
  configured module search path = ['/Users/cday/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/11.1.0_1/libexec/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/cday/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.13.1 (main, Dec  3 2024, 17:59:52) [Clang 16.0.0 (clang-1600.0.26.4)] (/opt/homebrew/Cellar/ansible/11.1.0_1/libexec/bin/python)
  jinja version = 3.1.5
  libyaml = True

Community.general Version

# /Users/cday/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 10.3.0 

# /opt/homebrew/Cellar/ansible/11.1.0_1/libexec/lib/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 10.1.0 

Configuration

CONFIG_FILE() = None
EDITOR(env: EDITOR) = /opt/homebrew/bin/hx

GALAXY_SERVERS:

OS / Environment

macOS Sequoia 15.2

Steps to Reproduce

Playbook with prefix:

# vi:syntax=yaml.ansible
---
- name: Setup
  hosts: localhost
  gather_facts: false
  become: false
  tasks:
    - name: Check version of community.general
      ansible.builtin.debug:
        msg: "community.general version {{ lookup('community.general.collection_version', 'community.general') }}"
    - name: Install ascii-image-converter
      community.general.homebrew:
        name:
          - TheZoraiz/ascii-image-converter/ascii-image-converter
        state: present

Playbook without prefix (may need to install tap first, not sure off the top of my head):

# vi:syntax=yaml.ansible
---
- name: Setup
  hosts: localhost
  gather_facts: false
  become: false
  tasks:
    - name: Check version of community.general
      ansible.builtin.debug:
        msg: "community.general version {{ lookup('community.general.collection_version', 'community.general') }}"
    - name: Install ascii-image-converter
      community.general.homebrew:
        name:
          - ascii-image-converter
        state: present

Expected Results

I expect it to install properly like it did before 10.2.0

Actual Results

Playbook with prefix output:

PLAY [Setup] *******************************************************************

TASK [Check version of community.general] **************************************
ok: [localhost] => {
    "msg": "community.general version 10.3.0"
}

TASK [Install ascii-image-converter] *******************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'pop from an empty set'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990260.753792-56418-224596319973783/AnsiballZ_homebrew.py\", line 107, in <module>\n    _ansiballz_main()\n    ~~~~~~~~~~~~~~~^^\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990260.753792-56418-224596319973783/AnsiballZ_homebrew.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990260.753792-56418-224596319973783/AnsiballZ_homebrew.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.homebrew', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.homebrew', _modlib_path=modlib_path),\n    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                     run_name='__main__', alter_sys=True)\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 889, in <module>\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 874, in main\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 424, in run\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 447, in _run\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 413, in _get_packages_info\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload__7p1kgcl/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 393, in _extract_package_name\nKeyError: 'pop from an empty set'\n", "module_stdout": "", "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Playbook without prefix:

PLAY [Setup] *******************************************************************

TASK [Check version of community.general] **************************************
ok: [localhost] => {
    "msg": "community.general version 10.3.0"
}

TASK [Install ascii-image-converter] *******************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'pop from an empty set'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990218.425856-56081-96306503754695/AnsiballZ_homebrew.py\", line 107, in <module>\n    _ansiballz_main()\n    ~~~~~~~~~~~~~~~^^\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990218.425856-56081-96306503754695/AnsiballZ_homebrew.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/cday/.ansible/tmp/ansible-tmp-1737990218.425856-56081-96306503754695/AnsiballZ_homebrew.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.homebrew', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.homebrew', _modlib_path=modlib_path),\n    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                     run_name='__main__', alter_sys=True)\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 889, in <module>\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 874, in main\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 424, in run\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 447, in _run\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 413, in _get_packages_info\n  File \"/var/folders/rc/5550b2c91z1_dlfcwgfn2t640000gp/T/ansible_community.general.homebrew_payload_0a3rw6u7/ansible_community.general.homebrew_payload.zip/ansible_collections/community/general/plugins/modules/homebrew.py\", line 393, in _extract_package_name\nKeyError: 'pop from an empty set'\n", "module_stdout": "", "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

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.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type) traceback labels Jan 27, 2025
@ansibullbot
Copy link
Collaborator

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.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added the module module label Jan 27, 2025
@felixfontein
Copy link
Collaborator

CC @UnknownPlatypus

@UnknownPlatypus
Copy link
Contributor

Thanks for the clear bug report @cdayjr, will have a look this week. Probably related to tap handling indeed. Sorry for the churn

@cdayjr
Copy link
Author

cdayjr commented Jan 27, 2025

No worries @UnknownPlatypus, thanks for jumping on it.

@UnknownPlatypus UnknownPlatypus linked a pull request Feb 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug callback callback plugin module module plugins plugin (any type) traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants