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

Can't inspect python packages for execution environment without warning #1867

Open
IPvSean opened this issue Oct 31, 2024 · 1 comment
Open
Labels
bug Researched, reproducible, committed to fix new New issues and PRs to triaged

Comments

@IPvSean
Copy link
Collaborator

IPvSean commented Oct 31, 2024

ISSUE TYPE
  • Bug Report
SUMMARY

I grab my ee:

podman pull quay.io/acme_corp/workshop_ee:bb2de800f0aa36bd76141ea9f81ee10bf32007e5

i go to images, then to python packages then I get this error->

image

ANSIBLE-NAVIGATOR VERSION
➜  ~ ansible-navigator --version
ansible-navigator 24.9.0
CONFIGURATION
LOG FILE
2024-08-14T15:01:12.187827+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/aws/plugins/modules/waf_web_acl.py ScannerError (get
3086│  in "<unicode string>", line 2, column 30:
3087│        community.aws.waf_web_acl:
3088│                                 ^
3089│2024-08-14T15:01:12.187837+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/aws/plugins/modules/waf_rule.py ScannerError (get_do
3090│  in "<unicode string>", line 2, column 27:
3091│        community.aws.waf_rule:
3092│                              ^
3093│2024-08-14T15:01:12.187848+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/aws/plugins/modules/waf_condition.py ScannerError (g
3094│  in "<unicode string>", line 2, column 32:
3095│        community.aws.waf_condition:
3096│                                   ^
3097│2024-08-14T15:01:12.187859+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/sops/plugins/lookup/sops.py ScannerError (get_docstr
3098│  in "<unicode string>", line 2, column 11:
3099│        author: Edoardo Tenani (@endorama) <e. ...
3100│              ^
3101│2024-08-14T15:01:12.187871+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/sops/plugins/vars/sops.py ScannerError (get_docstrin
3102│  in "<unicode string>", line 2, column 11:
3103│        author: Edoardo Tenani (@endorama) <e. ...
3104│              ^
3105│2024-08-14T15:01:12.187882+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/get_registrable_domain.yml Syntax
3106│2024-08-14T15:01:12.187895+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/remove_public_suffix.yml SyntaxEr
3107│2024-08-14T15:01:12.187906+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/get_public_suffix.yml SyntaxError
3108│2024-08-14T15:01:12.187917+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/remove_registrable_domain.yml Syn
3109│2024-10-31T14:33:31.304279+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
3110│Traceback (most recent call last):
3111│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
3112│    _warnings, json_str = output.split("{", 1)
3113│    ^^^^^^^^^^^^^^^^^^^
3114│ValueError: not enough values to unpack (expected 2, got 1)
3115│2024-10-31T14:33:31.307972+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was: Traceback (most recent call last):
3116│  File "/Users/sean/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
3117│    from typing import TypeAlias
3118│ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)
3119│Traceback (most recent call last):
3120│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
3121│    _warnings, json_str = output.split("{", 1)
3122│    ^^^^^^^^^^^^^^^^^^^
3123│ValueError: not enough values to unpack (expected 2, got 1)
3124│2024-10-31T14:34:18.648233+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
3125│Traceback (most recent call last):
3126│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
3127│    _warnings, json_str = output.split("{", 1)
3128│    ^^^^^^^^^^^^^^^^^^^
3129│ValueError: not enough values to unpack (expected 2, got 1)
3130│2024-10-31T14:34:18.651157+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was: Traceback (most recent call last):
3131│  File "/Users/sean/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
3132│    from typing import TypeAlias
3133│ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)
3134│Traceback (most recent call last):
3135│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
3136│    _warnings, json_str = output.split("{", 1)
3137│    ^^^^^^^^^^^^^^^^^^^
3138│ValueError: not enough values to unpack (expected 2, got 1)
3139│2024-10-31T14:36:39.071143+00:00 CRITICAL 'ansible_navigator.actions._actions.run_interactive' Subcommand 'select' encountered a fatal error.
3140│2024-10-31T14:36:39.073595+00:00 ERROR 'ansible_navigator.actions._actions.run_interactive' Logging an uncaught exception
3141│Traceback (most recent call last):
3142│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/_actions.py", line 172, in run_interactive
3143│    return run_action(app=app, interaction=interaction)
3144│           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3145│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/select.py", line 41, in run
3146│    app.steps.append(app.steps.current.select_func())  # add next
3147│                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3148│  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 330, in _build_image_content
3149│    self._images.selected["python"]["details"],
3150│    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^                                                                                                                                                                                             ▒
3151│KeyError: 'python'

more from log file

2024-08-14T15:01:12.187848+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/aws/plugins/modules/waf_condition.py ScannerError (get_docstring): mapping values are not allowed here
  in "<unicode string>", line 2, column 32:
        community.aws.waf_condition:
                                   ^
2024-08-14T15:01:12.187859+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/sops/plugins/lookup/sops.py ScannerError (get_docstring): mapping values are not allowed here
  in "<unicode string>", line 2, column 11:
        author: Edoardo Tenani (@endorama) <e. ...
              ^
2024-08-14T15:01:12.187871+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/sops/plugins/vars/sops.py ScannerError (get_docstring): mapping values are not allowed here
  in "<unicode string>", line 2, column 11:
        author: Edoardo Tenani (@endorama) <e. ...
              ^
2024-08-14T15:01:12.187882+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/get_registrable_domain.yml SyntaxError (get_docstring): invalid syntax (<unknown>, line 1)
2024-08-14T15:01:12.187895+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/remove_public_suffix.yml SyntaxError (get_docstring): invalid syntax (<unknown>, line 1)
2024-08-14T15:01:12.187906+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/get_public_suffix.yml SyntaxError (get_docstring): invalid syntax (<unknown>, line 1)
2024-08-14T15:01:12.187917+00:00 ERROR 'ansible_navigator.actions.collections._parse' /Users/sean/Library/Python/3.11/lib/python/site-packages/ansible_collections/community/dns/plugins/filter/remove_registrable_domain.yml SyntaxError (get_docstring): invalid syntax (<unknown>, line 1)
2024-10-31T14:33:31.304279+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
2024-10-31T14:33:31.307972+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was: Traceback (most recent call last):
  File "/Users/sean/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
    from typing import TypeAlias
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
2024-10-31T14:34:18.648233+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
2024-10-31T14:34:18.651157+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was: Traceback (most recent call last):
  File "/Users/sean/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
    from typing import TypeAlias
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
2024-10-31T14:36:39.071143+00:00 CRITICAL 'ansible_navigator.actions._actions.run_interactive' Subcommand 'select' encountered a fatal error.
2024-10-31T14:36:39.073595+00:00 ERROR 'ansible_navigator.actions._actions.run_interactive' Logging an uncaught exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/_actions.py", line 172, in run_interactive
    return run_action(app=app, interaction=interaction)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/select.py", line 41, in run
    app.steps.append(app.steps.current.select_func())  # add next
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ansible_navigator/actions/images.py", line 330, in _build_image_content
    self._images.selected["python"]["details"],
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'python'
STEPS TO REPRODUCE

download EE and try to look at python packages

EXPECTED RESULTS

won't crash

ACTUAL RESULTS

crashes, screenshot above

ADDITIONAL INFORMATION
@IPvSean IPvSean added bug Researched, reproducible, committed to fix new New issues and PRs to triaged labels Oct 31, 2024
@onefourfive
Copy link

Also seeing this issue for inspecting Ansible information in EE

$ ansible-navigator --version
ansible-navigator 24.6.0

Steps:

  • ansible-navigator images
  • navigate to EE
  • 2 for Ansible version and collections

Results:

Same error as above:

humph. Something went really wrong while introspecting the image.
Details have been added to the log file
[HINT] Please log an issue about this one, it shouldn't have happened
2024-11-08T01:15:08.326557+00:00 DEBUG 'ansible-runner.wrap_args_for_containerization' container engine invocation: docker run --rm --tty --interactive --workdir /runner/project -v /tmp/ssh-XXXXsCx6oA/:/tmp/ssh-XXXXsCx6oA/ -e SSH_AUTH_SOCK=/tmp/ssh-XXXXsCx6oA/agent.3825924 -v /home/me/.ssh/:/home/runner/.ssh/ -v /home/me/.ssh/:/root/.ssh/ -v /tmp/ansible-navigator_njod07nu/artifacts/:/runner/artifacts/:Z -v /tmp/ansible-navigator_njod07nu/:/runner/:Z -v /home/me/.cache/ansible-navigator/:/home/me/.cache/ansible-navigator/ --env-file /tmp/ansible-navigator_njod07nu/artifacts/98c107fc-e537-4a02-aee8-10d6d5df23ac/env.list --user=1000 --name ansible_runner_98c107fc-e537-4a02-aee8-10d6d5df23ac cgei-docker-release-virtual.artifactory.megacorp.com/cgei-unstable/infra-awx-ee:local /usr/bin/python3 /home/me/.cache/ansible-navigator/image_introspect.py
2024-11-08T01:15:08.326609+00:00 DEBUG 'ansible-runner.handle_command_wrap' command: docker run --rm --tty --interactive --workdir /runner/project -v /tmp/ssh-XXXXsCx6oA/:/tmp/ssh-XXXXsCx6oA/ -e SSH_AUTH_SOCK=/tmp/ssh-XXXXsCx6oA/agent.3825924 -v /home/me/.ssh/:/home/runner/.ssh/ -v /home/me/.ssh/:/root/.ssh/ -v /tmp/ansible-navigator_njod07nu/artifacts/:/runner/artifacts/:Z -v /tmp/ansible-navigator_njod07nu/:/runner/:Z -v /home/me/.cache/ansible-navigator/:/home/me/.cache/ansible-navigator/ --env-file /tmp/ansible-navigator_njod07nu/artifacts/98c107fc-e537-4a02-aee8-10d6d5df23ac/env.list --user=1000 --name ansible_runner_98c107fc-e537-4a02-aee8-10d6d5df23ac cgei-docker-release-virtual.artifactory.megacorp.com/cgei-unstable/infra-awx-ee:local /usr/bin/python3 /home/me/.cache/ansible-navigator/image_introspect.py
2024-11-08T01:15:09.545534+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
Traceback (most recent call last):
  File "/home/me/.local/lib/python3.12/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
2024-11-08T01:15:09.548680+00:00 DEBUG 'ansible_navigator.actions.images._parse' error json loading output: 'not enough values to unpack (expected 2, got 1)'
2024-11-08T01:15:09.548974+00:00 DEBUG 'ansible_navigator.actions.images._parse' Traceback (most recent call last):
  File "/home/me/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
    from typing import TypeAlias
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)

2024-11-08T01:15:09.549107+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was: Traceback (most recent call last):
  File "/home/me/.cache/ansible-navigator/image_introspect.py", line 16, in <module>
    from typing import TypeAlias
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib64/python3.9/typing.py)
Traceback (most recent call last):
  File "/home/me/.local/lib/python3.12/site-packages/ansible_navigator/actions/images.py", line 537, in _parse
    _warnings, json_str = output.split("{", 1)
    ^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Researched, reproducible, committed to fix new New issues and PRs to triaged
Projects
Status: No status
Development

No branches or pull requests

2 participants