-
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
Salt-master crippled after receiving too much output from salt command. #55180
Comments
@H20-17 Thank you for reporting this issue. I am however not able to replicate it. For me running that command, it produces about 32000 lines of output and takes about 15 seconds to run. The master is still alive and can continue to run commands. |
I tried this again today and I got the same behaviour I got when I reported this. I also get the following error in the salt master log
It looks like some problem is occuring that isn't getting handled properly. I didn't succeed in getting it to compromise the functioning of the salt master again today, but it happened yesterday. |
It still seems to trigger the condition where the salt-master is crippled. It's not definite though since I can't get 100% reliability. After this happens once, about 1/5 salt commands timeout. Probably repeating it will increase the frequency. |
@saltstack/team-core @saltstack/team-windows Can any of you take a look at this? Thanks. |
@H20-17, can you check to see if the solutions/discussions in #54884, or #53230 solve your problem? Some versions of msgpack impose outrageous defaults to prevent denial of service attacks and result in that particular exception being thrown. Pinning your msgpack to a different version will likely solve that exception that you're seeing. The thing that really sucks is that msgpack literally switched the kwargs used for this between minor versions, so it's not too easy for saltstack to support every single version of msgpack out there. Maybe warnings should be thrown when using weird/untested versions of a module or we should bump the msgpack version in |
I'm sure it is msgpack and I'm not blaming the salt people for whatever is going on but something like a DOS occurs right now and I don't understand why the salt master software isn't dealing with it anyway. (However I don't know any of the underlying details if I'm asking too much). I'm OK with this being closed now since it seems to be the focus of several other open issues. |
I just set this environment up and my master is having no problem. I ran the command back-to-back and it seems fine. Is it possible this is a system issue or a network issue outside of salt? I mean, just thinking kind of outside the box but I piped the output to a file and it came back as 4.07mb. That doesn't seem to be anything the master would trip over.... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
This should be closed as a msgpack issue...but @xeacott. Generally to test these msgpack-related issues we have to keep in mind that msgpack gets compressed and so to properly test these boundaries we'd need the state data to contain non-compressible data in order to exercise this particular code path. The best way to generate noncompressible data is with white noise or output from a block cipher (which is nearly random as well). If you're in a posix environment, you can feed the /dev/random block device through i.e. to generate a 1.5mb (mostly) non-compressible kwarg to output into a state so it will get compressed by msgpack:
|
Thank you for updating this issue. It is no longer marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
salt 3000 introduced a dependency on Python msgpack >= 0.6. In msgpack 0.6 their developers changed the max length of a string that could be unpacked from 2GiB to 1MiB. They then proceeded to change it to 100MiB in msgpack 1.0. Now when using msgpack >=0.6 and < 1.0, any message that is unpacked larger than 1MiB will throw an error. For example a file state which tries to send a file larger than 1MiB will get the following error: Unable to manage file: 1048688 exceeds max_str_len(1048576) This error could send the master into a tailspin where subsequent file operations take a long time or just time out. This patch sets the keyword argument max_buffer_size for the Unpacker to 100MiB which is the msgpack 1.0 default now. It will allow people to use msgpack versions >.6 and < 1.0 without this crazy low limit. It should be discussed if we go back to the 2GiB size from < 0.6 days (my vote), or just anything larger than 100MB. This code does a version check, and will only set the keyword on msgpack > = 0.6 and < 1.0. The test checks that we have a buffer size of at least 100MiB in case the Python msgpack devs decide to lower this value again, and break things. We want enforce a decent minimum. fixes saltstack#53230, fixes saltstack#54884, fixes saltstack#55180, fixes saltstack#55184, fixes saltstack#57026, fixes saltstack#57921
salt 3000 introduced a dependency on Python msgpack >= 0.6. In msgpack 0.6 their developers changed the max length of a string that could be unpacked from 2GiB to 1MiB. They then proceeded to change it to 100MiB in msgpack 1.0. Now when using msgpack >=0.6 and < 1.0, any message that is unpacked larger than 1MiB will throw an error. For example a file state which tries to send a file larger than 1MiB will get the following error: Unable to manage file: 1048688 exceeds max_str_len(1048576) This error could send the master into a tailspin where subsequent file operations take a long time or just time out. This patch sets the keyword argument max_buffer_size for the Unpacker to 100MiB which is the msgpack 1.0 default now. It will allow people to use msgpack versions >.6 and < 1.0 without this crazy low limit. It should be discussed if we go back to the 2GiB size from < 0.6 days (my vote), or just anything larger than 100MB. This code does a version check, and will only set the keyword on msgpack > = 0.6 and < 1.0. The test checks that we have a buffer size of at least 100MiB in case the Python msgpack devs decide to lower this value again, and break things. We want enforce a decent minimum. fixes saltstack#53230, fixes saltstack#54884, fixes saltstack#55180, fixes saltstack#55184, fixes saltstack#57026, fixes saltstack#57921
salt 3000 introduced a dependency on Python msgpack >= 0.6. In msgpack 0.6 their developers changed the max length of a string that could be unpacked from 2GiB to 1MiB. They then proceeded to change it to 100MiB in msgpack 1.0. Now when using msgpack >=0.6 and < 1.0, any message that is unpacked larger than 1MiB will throw an error. For example a file state which tries to send a file larger than 1MiB will get the following error: Unable to manage file: 1048688 exceeds max_str_len(1048576) This error could send the master into a tailspin where subsequent file operations take a long time or just time out. This patch sets the keyword argument max_buffer_size for the Unpacker to 100MiB which is the msgpack 1.0 default now. It will allow people to use msgpack versions >.6 and < 1.0 without this crazy low limit. It should be discussed if we go back to the 2GiB size from < 0.6 days (my vote), or just anything larger than 100MB. This code does a version check, and will only set the keyword on msgpack > = 0.6 and < 1.0. The test checks that we have a buffer size of at least 100MiB in case the Python msgpack devs decide to lower this value again, and break things. We want enforce a decent minimum. fixes saltstack#53230, fixes saltstack#54884, fixes saltstack#55180, fixes saltstack#55184, fixes saltstack#57026, fixes saltstack#57921
salt 3000 introduced a dependency on Python msgpack >= 0.6. In msgpack 0.6 their developers changed the max length of a string that could be unpacked from 2GiB to 1MiB. They then proceeded to change it to 100MiB in msgpack 1.0. Now when using msgpack >=0.6 and < 1.0, any message that is unpacked larger than 1MiB will throw an error. For example a file state which tries to send a file larger than 1MiB will get the following error: Unable to manage file: 1048688 exceeds max_str_len(1048576) This error could send the master into a tailspin where subsequent file operations take a long time or just time out. This patch sets the keyword argument max_buffer_size for the Unpacker to 100MiB which is the msgpack 1.0 default now. It will allow people to use msgpack versions >.6 and < 1.0 without this crazy low limit. It should be discussed if we go back to the 2GiB size from < 0.6 days (my vote), or just anything larger than 100MB. This code does a version check, and will only set the keyword on msgpack > = 0.6 and < 1.0. The test checks that we have a buffer size of at least 100MiB in case the Python msgpack devs decide to lower this value again, and break things. We want enforce a decent minimum. fixes #53230, fixes #54884, fixes #55180, fixes #55184, fixes #57026, fixes #57921
salt 3000 introduced a dependency on Python msgpack >= 0.6. In msgpack 0.6 their developers changed the max length of a string that could be unpacked from 2GiB to 1MiB. They then proceeded to change it to 100MiB in msgpack 1.0. Now when using msgpack >=0.6 and < 1.0, any message that is unpacked larger than 1MiB will throw an error. For example a file state which tries to send a file larger than 1MiB will get the following error: Unable to manage file: 1048688 exceeds max_str_len(1048576) This error could send the master into a tailspin where subsequent file operations take a long time or just time out. This patch sets the keyword argument max_buffer_size for the Unpacker to 100MiB which is the msgpack 1.0 default now. It will allow people to use msgpack versions >.6 and < 1.0 without this crazy low limit. It should be discussed if we go back to the 2GiB size from < 0.6 days (my vote), or just anything larger than 100MB. This code does a version check, and will only set the keyword on msgpack > = 0.6 and < 1.0. The test checks that we have a buffer size of at least 100MiB in case the Python msgpack devs decide to lower this value again, and break things. We want enforce a decent minimum. fixes #53230, fixes #54884, fixes #55180, fixes #55184, fixes #57026, fixes #57921
Description of Issue
I have a salt-master (v 2019.2.2 py3) and a salt minion (v 2019.2.2 py3). The salt minion is a Windows salt-minion and I have no idea if that makes any difference. If the salt-master receives too much output from the minion it cripples the salt master and the salt master does not auto-recover. Instead it has to be restarted.
Setup
No special setup other than as described in the Description
Steps to Reproduce Issue
Run the following command
That command will translate to
on the minion, which produces thousands of lines of output (in my case approx 35000 lines of output).
I don't have any opinion on whether or not the master should be able to handle this volume of output. EIther it should or it shouldn't, but the master shouldn't get done in by this. If the master is receiving too much output it should just cut the minion off and handle this gracefully.
What I observe is that the master just hangs or times out (I'm not sure which) and it doesn't print the job response (although jobs.lookup_jid does show you something).
That in itself isn't a big issue, but the thing is is that the master never recovers. The salt command on the master does not work after this and you have to restart the master.
Versions Report
The text was updated successfully, but these errors were encountered: