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

ansible-navigator Fails to Provide General Information for Images #1899

Closed
laurentiuandries opened this issue Dec 18, 2024 · 0 comments
Closed
Labels
bug Researched, reproducible, committed to fix new New issues and PRs to triaged

Comments

@laurentiuandries
Copy link

laurentiuandries commented Dec 18, 2024

ISSUE TYPE
  • Bug Report
SUMMARY

When using ansible-navigator with container images, only the "Image information" section works correctly. Attempting to retrieve other information, such as "General information," results in the following error message:

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
ANSIBLE-NAVIGATOR VERSION
ansible-navigator 24.12.1.dev2

(The issue persists with other versions as well)

CONFIGURATION
LOG FILE
024-12-18T14:54:24.519449+00:00 ERROR 'ansible_navigator.actions.images._parse' Unable to extract introspection from stdout
Traceback (most recent call last):
  File "/home/landries/projects/ansible-navigator/src/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-12-18T14:54:24.520739+00:00 ERROR 'ansible_navigator.actions.images._parse' Image introspection failed (parsed), the return value was:
Traceback (most recent call last):
  File "/home/landries/projects/ansible-navigator/src/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)
STEPS TO REPRODUCE
  1. Run ansible-navigator with a container image.
  2. Attempt to view "General information" or other introspection details.
EXPECTED RESULTS

The "General information" and other details should be displayed without errors.

ACTUAL RESULTS

The error above is shown.

ADDITIONAL INFORMATION
Root Cause (Debug Findings):

Upon debugging, the issue probably lies in src > ansible_navigator > data > image_introspect.py when trying to gather information about system packages.

Code snippet from image_introspect.py:

    try:
        command_runner = CommandRunner()
        commands: list[CmdParser] = [
            AnsibleCollections(),
            AnsibleVersion(),
            OsRelease(),
            RedhatRelease(),
            PythonPackages(),
            # SystemPackages(),
        ]
        results = command_runner.run_multi_thread(commands)

For debugging purposes, SystemPackages() was commented out, leading to the expected, functioning result.
Otherwise, JSON-dumping the result hangs indefinitely.

Related Issues:

#1867
#1795

@laurentiuandries laurentiuandries added bug Researched, reproducible, committed to fix new New issues and PRs to triaged labels Dec 18, 2024
@laurentiuandries laurentiuandries changed the title ansible-navigator Fails to Provide General Information for Images When Using Default Runner Mode (pexpect) ansible-navigator Fails to Provide General Information for Images Dec 20, 2024
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
Archived in project
Development

No branches or pull requests

1 participant