-
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] Batch execution of multiple modules fails with salt global exception #60361
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Verified this using this command
I get the same result. Looking at the code, This fix would stop the exception, but AFAICT this should be working (though, I couldn't get back to a point where it was working, so it's possible that it never did? 🤷 ) |
Digging into this a bit more, it's definitely due to Lines 222 to 247 in ead47e4
No other changes are necessary - that will make this existing code work. Granted, I don't think that's a comprehensive fix, but it does solve this particular problem. Some time between then and now, that block got changed in an unexpected way, causing the failure that we're seeing. From what I can see, the correct fix would be to add some tests to verify that run is, in fact, returning expected data not just for the cases where there's a single return, but for multiple returns and every case, and ensure that all of the expected data is being returned. Naturally there should be some failures based on the current state, but... that's where this fix should happen 👍 |
I was going to test the above batch.py to see if it would solve this bug, but that commit appears to be very old (2016ish) -- the batch.py file supplied with Salt 3003 is very different (https://github.com/saltstack/salt/blob/9242a14ebc204044cc585f337591cf85d997501e/salt/cli/batch.py) |
Is there any more information I can provide here? Not clear on next steps. |
@bzukdatto I have verified this is still an issue with
and will start working on a fix, using what you and @waynew have already said as a launching pad. |
Actually, I've confirmed that normal retcodes are also returning incorrectly in normal scenarios. It seems, as @waynew stated, batch.py got messed up somewhere in the past, and I'd like to keep the fix local to that file if able since it really is a problem with how it operates. |
Description
Batched running of multiple modules fails due to TypeError exception. Both batch.py and salt.py assume a single return code for batched execution runs, but running multiple modules results in a dictionary of return codes.
Applied the following patches to job.py and salt.py and they appear to fix the issue
Setup
Salt master and multiple syndics all running 3003.
Minions running 3003
Steps to Reproduce the behavior
Run a batch command with multiple modules:
salt --no-color --hide-timeout --timeout 30 --out json --out-file /tmp/cldeng-20519.txt '*' -b 50 virt.full_info,cmd.run ,'/bin/true'
Get the following stack trace:
(Include debug logs if possible and relevant)
Expected behavior
Commands return successfully and report the correct return code (highest value returned)
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: