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

[PR #7521/b4a2e9da backport][stable-8] Lxd instance not found fix false positives #7671

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 3, 2023

This is a backport of PR #7521 as merged into main (b4a2e9d).

SUMMARY

lxd: avoid false positives in "instance not found" detection in the lxd connection plugin

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lxd connection plugin

ADDITIONAL INFORMATION

before:

fatal: [my-rpi-399]: UNREACHABLE! => {
    "changed": false,
    "msg": "instance not found: my-rpi-399",
    "unreachable": true
}

after:

fatal: [my-rpi-399]: FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "ansible.legacy.setup": {
            "failed": true,
            "module_stderr": "/bin/sh: 1: /usr/bin/python3: not found\nError: Command not found\n",
            "module_stdout": "",
            "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error",
            "rc": 127
        }
    },
    "msg": "The following modules failed to execute: ansible.legacy.setup\n"
}

* lxd: Add lxc command execution debug statement.

* lxd: avoid false positives in "instance not found" detection

Due to changes over time in the error message which lxd printed when an
instance wasn't found, the detection logic in the lxd connection plugin
matched any "not found" string.  Unfortunately this also false triggered
on other errors e.g. "/usr/bin/python3: not found" from the payload,
giving a confusing error message "UNREACHABLE! ... instance not found"
to the ansible user.

* Update changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b4a2e9d)
@felixfontein felixfontein merged commit 4482b04 into stable-8 Dec 3, 2023
123 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/b4a2e9da50d7483c985e8fc2bcfb12db75b437c4/pr-7521 branch December 3, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants