securityonion icon indicating copy to clipboard operation
securityonion copied to clipboard

FIX: Intermittent soup errors causing soup to exit with failure message

Open jertel opened this issue 8 months ago • 0 comments

  1. When shutting down salt-master, if it exits before the tail --pid ... command starts then the tail will error out and a message is echo'd to console that the salt-master did not shutdown within 30 seconds. That's not correct and should not be printed out in that situation. Ex:
tail: invalid PID: ''
salt-master still running at 10:13:25.600201 after waiting 30s. We cannot kill due to systemd restart option.
  1. Soup needs to set +e before upgrading the elastic agent and then reset back to set -e after it returns. This will prevent soup from exiting if the first curl fails (it's in a retry loop). Ex:
Checking to see if changes are needed.
parse error: Invalid numeric literal at line 1, column 7
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    68  100    30  100    38   1917   2Kibana server is not ready yet428 --:--:-- --:--:-- --:--:--  4533
Checking if Elastic Agent update is necessary...
Executing command with retry support: curl --fail --retry 5 --retry-delay 15 -L 'https://repo.security((redacted)).net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-8.10.4.tar.gz' --output '/nsm/elastic-fleet/artifacts/elastic-agent_SO-8.10.4.tar.gz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 55 1389M   55  778M    0     0  10.2M      0  0:02:15  0:01:15  0:01:00  7597
curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

It's TBD where the parse error originated in this example.

jertel avatar Jun 21 '24 20:06 jertel