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

Warning: failed to parse requirements from paloaltonetworks.panos, error: not enough values to unpack (expected 1, got 0) #447

Open
ansiblejunky opened this issue Jun 15, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ansiblejunky
Copy link

Describe the bug

Using ansible-builder to include the latest version of this collection into an Execution Environment, I am seeing the following error to pull and use the requirements.txt from this collection:
Warning: failed to parse requirements from paloaltonetworks.panos, error: not enough values to unpack (expected 1, got 0)
That results in the python deps not being included in the build and I have to explicitly define them to ansible-builder adds it.
I'm using ansible-builder v1.2.0, ansible-core 2.14, and using podman v4.2.0 to build container.

Expected behavior

ansible-builder uses the requirements.txt from this repo to install the proper deps

Current behavior

ansible-builder fails with:

Warning: failed to parse requirements from paloaltonetworks.panos, error: not enough values to unpack (expected 1, got 0)
@ansiblejunky ansiblejunky added the bug Something isn't working label Jun 15, 2023
@welcome-to-palo-alto-networks

🎉 Thanks for opening your first issue here! Welcome to the community!

@spikefishjohn
Copy link

spikefishjohn commented Aug 11, 2023

I'm seeing the same thing. Here is a little more info. I think its the introspect.py that is failing. I almost wonder if introspect.py can't parse requirements.txt because of the hashes in it.

--> ec10a2c35f7
[3/4] STEP 12/13: RUN $PYCMD /output/scripts/introspect.py introspect --sanitize --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
Warning: failed to parse requirements from paloaltonetworks.panos, error: not enough values to unpack (expected 1, got 0)
Creating parent directory for /tmp/src/requirements.txt
---
python:
- 'pan_os_python==1.8.0  # from collection user'
- 'pan_python==0.17.0  # from collection user'
- 'xmltodict==0.12.0  # from collection user'
system: []

Note, I did a raw installed on debian with python3.9 and pip3 and did a pip3 install -r requirement.txt and it completed without issue or complaint.

As a work around I added the modules to a requirement.txt for ansible-builder (which is the build output listed above to be clear) and it seems to build via ansible-builder.

[klauskinski@supertower Anisble-Builder]$ egrep panos output.txt
Downloading https://galaxy.ansible.com/download/paloaltonetworks-panos-2.17.3.tar.gz to /home/runner/.ansible/tmp/ansible-local-1zqt9r2_v/tmph36d9i61/paloaltonetworks-panos-2.17.3-eginftxn
Installing 'paloaltonetworks.panos:2.17.3' to '/usr/share/ansible/collections/ansible_collections/paloaltonetworks/panos'
paloaltonetworks.panos:2.17.3 was installed successfully
Warning: failed to parse requirements from paloaltonetworks.panos, error: not enough values to unpack (expected 1, got 0)
[klauskinski@supertower Anisble-Builder]$

FYI I've just started using ansible-builder so I don't know for sure yet if this works, so grain of salt and all.

@spikefishjohn
Copy link

Here is my requirements.txt and relevant execution-environment.yml section if it helps.

[klauskinski@supertower Anisble-Builder]$ cat requirements.txt
pan-os-python==1.8.0
pan-python==0.17.0
xmltodict==0.12.0
[klauskinski@supertower Anisble-Builder]$ cat execution-environment.yml
---
version: 3
dependencies:
  galaxy: requirements.yml
  python: requirements.txt

@spikefishjohn
Copy link

spikefishjohn commented Aug 14, 2023

ok so long story short. the requirements.txt parser found in Ansible-builder doesn't support breaking up long lines with "\" in addition it doesn't support --hash lines.

I opened issue #593 with Ansible-builder about this. It was closed today and marked as a duplicate of issue #319.

I don't think there is any reason to change requirements.txt in pan-os-ansible and the work around I listed above is working in our lab.

Not sure if you want to keep this open but it seems like there is no action to take on this side of the fence and anyone wanting to see whats going on with ansible-builder can follow the threads listed above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants