[BUG] Salt API 3004.2 returning empty response when calling GET minions endpoint /minions/<mid>
Description
After some amount of calls to the SALT API checking if a minion exists I get empty responses from minions that do exist. When I call the SALT api I get empty response (16 bytes) and status code 200, but when I call salt 'minion1' test.ping from the command line, I get the proper response True. The amount of calls is 60 in parallel every 5 seconds.
[27/Jun/2023:03:54:45] "GET /minions/minion1 HTTP/1.1" 200 16 "" "Go-http-client/1.1"
Setup
Custom options that might be relevant:
worker_threads: 12 sock_pool_size: 15
System setup:
- VM running in Linode: 6 CPU Cores, 16 GB RAM
- used bootstrap to install
Steps to Reproduce the behavior We are calling the salt api multiple times in parallel. 60 calls in parallel every 5 seconds.
Expected behavior If the salt-api is overloaded why is it not returning 429 or 500 status code, it's returning 200 instead.
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. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
- Community Wiki
- Salt’s Contributor Guide
- Join our Community Slack
- IRC on LiberaChat
- Salt Project YouTube channel
- Salt Project Twitch channel
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. If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
@djmmatracki 3004.x is out of support.
Can you verify that the same issue exists in 3006.1?
@s0undt3ch Yes, we upgraded the version to 3006.1 and we observe the same behaviour.
So, the master might be getting overloaded with that many requests. If this happens, it might have a hard time keeping up with the minion returns and assume that the minion did not return, hence the 200 response.
The minion not returning in the expected timeout is not an error in salt.
This is just a wild guess of what could be happening.
How many minions are managed by the master where salt-api is running?
We have an infrastructure with syndics and targeted minions is < 200. We are making tones of requests about job status to the salt-api. The problem is that instead of receiving 4xx or 5xx status codes we are getting a valid empty response with status code 200.
We were also assuming that it is because of the load on the salt-master, but the fact that we receive the 200 status code is preventing us from handling the error on the api client side.
Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.
Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.
If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.