-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] salt-ssh error reporting/handling of remote errors/misbehavior is optimistic to a fault #64531
Labels
Milestone
Comments
lkubb
changed the title
[BUG] salt-ssh error reporting/handling of remote errors is optimistic to a fault
[BUG] salt-ssh error reporting/handling of remote errors/misbehavior is optimistic to a fault
Jun 22, 2023
3 tasks
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Jun 23, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Jun 25, 2023
This commit ensures that output indicating failure is not passed off as the output of the command when it is called via `__salt__`, e.g. during template rendering or in wrapper modules. It does this by raising exceptions when issues are detected and thus simulates the remote error locally. See issue saltstack#64531 for a detailed description.
3 tasks
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Jun 28, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Jun 28, 2023
This commit ensures that output indicating failure is not passed off as the output of the command when it is called via `__salt__`, e.g. during template rendering or in wrapper modules. It does this by raising exceptions when issues are detected and thus simulates the remote error locally. See issue saltstack#64531 for a detailed description.
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Oct 19, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Oct 19, 2023
This commit ensures that output indicating failure is not passed off as the output of the command when it is called via `__salt__`, e.g. during template rendering or in wrapper modules. It does this by raising exceptions when issues are detected and thus simulates the remote error locally. See issue saltstack#64531 for a detailed description.
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Dec 18, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this issue
Dec 18, 2023
This commit ensures that output indicating failure is not passed off as the output of the command when it is called via `__salt__`, e.g. during template rendering or in wrapper modules. It does this by raising exceptions when issues are detected and thus simulates the remote error locally. See issue saltstack#64531 for a detailed description.
dwoz
pushed a commit
that referenced
this issue
Dec 18, 2023
dwoz
pushed a commit
that referenced
this issue
Dec 18, 2023
This commit ensures that output indicating failure is not passed off as the output of the command when it is called via `__salt__`, e.g. during template rendering or in wrapper modules. It does this by raising exceptions when issues are detected and thus simulates the remote error locally. See issue #64531 for a detailed description.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
There are several situations in which salt-ssh deviates from regular salt-call regarding error reporting/handling. This is intended as a collective issue/overview since they are related.
state.*
wrappers treat an exception during the state run on the target as success.FunctionWrapper
, remote errors/exceptions are generally swallowed. The function seemingly returns the error dict now..a This results in undefined behavior in wrapper modules and rendering templates which call non-wrapped modules that raise an exception.
.b This also results in mine functions that cause remote exceptions to happily pass along the error dict as the function's return without reporting a non-zero exitcode.
FunctionWrapper
, local deserialization errors are generally swallowed. The function seemingly returns the error dict now..a see 2.a
.b see 2.b
.c This might be related to salt-ssh return exit code 0 if salt-call fails to run #50727 if still relevant.
FunctionWrapper
and the remote does not return a dict containing "return", an empty dict is returned instead..a see 2.a
.b see 2.b
Setup
irrelevant
Steps to Reproduce the behavior
See linked issues.
(1) Is a bit hard to reproduce since it requires Salt crashing on the remote, but can be easily inferred from the code:
salt/salt/client/ssh/wrapper/state.py
Lines 723 to 739 in b0bf7eb
(2.a) #52452 (comment)
(2.b)
salt/salt/client/ssh/__init__.py
Line 1282 in b0bf7eb
(2/3/4)
salt/salt/client/ssh/wrapper/__init__.py
Lines 129 to 141 in b0bf7eb
(2/3/4) might come into play for any wfunc call
salt/salt/client/ssh/__init__.py
Lines 1137 to 1142 in b0bf7eb
Expected behavior
Behave as similarly as possible to salt-call. Treat exceptions as exceptions, report them as such and especially do not pass off a truthy value as the return of a function that clearly failed.
Versions Report
Still present in current master.
Additional context
Related:
QubesOS/qubes-issues#8146 (1)
#50727 (maybe 3)
#52452 (2.a)
#64514 (already fixed yesterday)
The text was updated successfully, but these errors were encountered: