-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Salt exits with status 0 when it fails to render a state #7993
Comments
FYI: I just submitted a fix upstream for this issue, it was merged and will be in |
Thanks @lkubb! Qubes should probably backport this patch. |
Automated announcement from builder-github The component
|
Adding “backport pending” because R4.1 is still affected. |
The patch causes regression: saltstack/salt#64575. So, no backporting until it's fixed (and if not fixed soon, I'll need to revert the patch itself). |
@marmarek Without having much to go on, I have to assume it's caused by https://github.com/saltstack/salt/blob/c463c94b8d29ba4ebfeb45c36b7d7b6653e9711f/salt/client/ssh/__init__.py#L555-L559 and the remote returning something like Would you be able to patch the line and see if that fixes the stacktrace? diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py
index 0d9ac9509b..88449b4c6e 100644
--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
@@ -554,7 +554,7 @@ class SSH(MultiprocessingStateMixin):
ret["ret"] = data["local"]
try:
# Ensure a reported local retcode is kept
- retcode = data["local"]["retcode"]
+ retcode = int(data["local"]["retcode"])
except (KeyError, TypeError):
pass
else: Either way it would be very helpful to see the final output, so if the above does not work, you could just force the retcode to be an int where the stacktrace happens. diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py
index 0d9ac9509b..e04d9c5234 100644
--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
@@ -807,7 +807,7 @@ class SSH(MultiprocessingStateMixin):
final_exit = 0
for ret, retcode in self.handle_ssh():
host = next(iter(ret))
- final_exit = max(final_exit, retcode)
+ final_exit = max(final_exit, int(retcode))
self.cache_job(jid, host, ret[host], fun)
ret = self.key_deploy(host, ret) I have a Qubes dev setup as well, so if it's something I can reproduce there without much hassle, I'm happy to do the above myself. |
Unfortunately, I do not have reliable reproducer. I noticed it on one test run (given number of test runs since applying the patch, the reproduction rate is about 10%, could be worse).
Yes, I think so.
Unfortunately, I don't have returned data in any log, so cannot say for sure. But likely something like this. |
You're right, it should be |
I'm not sure if |
I agree, 0 would have been a quick fix for testing only. That's very impractical in CI ofc. I actually reworked the salt-ssh error handling a lot since submitting this PR to fix other issues, so my picture of the current code is a bit hazy, but forcing it to 1 in those cases should be fine. Edit: In the meantime, I'm quite certain I found the source of the |
Automated announcement from builder-github The component
|
Automated announcement from builder-github The component
|
Drop patches included upstream already. Fix for saltstack/salt#64575 was just merged upstream, but isn't included in 3006.4 yet, so keep it here. QubesOS/qubes-issues#7993
Drop patches included upstream already. Fix for saltstack/salt#64575 was just merged upstream, but isn't included in 3006.4 yet, so keep it here. QubesOS/qubes-issues#7993
How to file a helpful issue
Qubes OS release
R4.1
Brief summary
If Salt fails to render a state (because of duplicate keys for example), the exit code of
qubesctl
is 0.Steps to reproduce
Create a state that has duplicate keys in a YAML map.
Expected behavior
Non-zero exit code
Actual behavior
Zero exit code
The text was updated successfully, but these errors were encountered: