-
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
[master] Improve salt-ssh error handling #64542
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3da07b9
to
d1146ce
Compare
998a939
to
7eea362
Compare
@lkubb Awesome, lets hope all the tests pass now :D |
s0undt3ch
approved these changes
Dec 18, 2023
This was referenced Dec 18, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 18, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 18, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 28, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 28, 2023
dwoz
pushed a commit
to lkubb/salt
that referenced
this pull request
Dec 29, 2023
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 29, 2023
Before PR saltstack#64542, SSH error returns depended on whether the command was executed non-wrapped or wrapped. The former would always return an error dict including `stdout` and `stderr` keys, while the latter would return a string. Synchronizing this behavior to work like usual introduced a breaking change, which was reverted afterwards. This cleans up unnecessary code after the revert of the mentioned behavior. 1) SSHCommandExecutionErrors are only thrown when retcode > 0 2) `Probably got garbage` is the return of the module which should never be reached (when failing, it's in the returned string, it's never found in a dict key `ret["stderr"]`).
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 29, 2023
Before PR saltstack#64542, SSH error returns depended on whether the command was executed non-wrapped or wrapped. The former would always return an error dict including `stdout` and `stderr` keys, while the latter would return a string. Synchronizing this behavior to work like usual introduced a breaking change, which was reverted afterwards. This cleans up unnecessary code after the revert of the mentioned behavior. 1) SSHCommandExecutionErrors are only thrown when retcode > 0 2) `Probably got garbage` is the return of the module which should never be reached (when failing, it's in the returned string, it's never found in a dict key `ret["stderr"]`).
3 tasks
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Dec 29, 2023
dwoz
pushed a commit
that referenced
this pull request
Dec 30, 2023
Before PR #64542, SSH error returns depended on whether the command was executed non-wrapped or wrapped. The former would always return an error dict including `stdout` and `stderr` keys, while the latter would return a string. Synchronizing this behavior to work like usual introduced a breaking change, which was reverted afterwards. This cleans up unnecessary code after the revert of the mentioned behavior. 1) SSHCommandExecutionErrors are only thrown when retcode > 0 2) `Probably got garbage` is the return of the module which should never be reached (when failing, it's in the returned string, it's never found in a dict key `ret["stderr"]`).
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Mar 7, 2024
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
May 16, 2024
This was referenced May 31, 2024
3 tasks
lkubb
added a commit
to lkubb/salt
that referenced
this pull request
Aug 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This will stay a draft until #64576 finds its way into master (or the regression is fixed otherwise)Since there has been no activity on the referenced PR for months, I went ahead and merged it into this branch to unblock this PR.It's in. :)What does this PR do?
state.*
wrappers treat non-decodable json output (usually caused by Salt crashing completely and printing a stacktrace only) as an error condition.What issues does this PR fix or reference?
Fixes: #52452
Fixes: #64531
Fixes: #42065
Fixes: #50727 (last-minute addition: after re-reading the report, I think it's relatively clear why it was not working before and that this should fix it, see test in tests/pytests/integration/ssh/state/test_retcode_state_run_remote_exception.py)
Previous Behavior
New Behavior
Merge requirements satisfied?
Commits signed with GPG?
Yes