When in changes only mode, with no heartbeat, 'rudder agent run' outputs 'error: Rudder agent was interrupted during execution by a fatal error.'
In the case where an agent is in changes only mode, but does output some messages (repaired, errors, or just the heartbeat), the output from "rudder agent run" is fine.
However, is the agent isn't due to send a heartbeat, and there a re no repaired/error messages, there is exactly 0 lines of output from the agent run. In this case, 'rudder agent run' outputs an error saying "error: Rudder agent was interrupted during execution by a fatal error."
This is because the reports.awk script looks for the "end run" message, but never finds it.
We should detect the reporting mode and use this in the awk script to check if we're in changes only mode, and output an info message instead that says something like 'This agent is in changes only mode - no components caused repairs or errors, so no output statistics can be reported. Run with -i to see log messages.'
#4 Updated by Nicolas CHARLES 5 months ago
a possible way would be to have a simple end reports, saying that everything is ok (a small "ok" or something), not in the Rudder format so that it's not sent via syslog, and that would be catched by the rudder command
or patching the agent to get a meaningful exit code
#6 Updated by Jonathan CLARKE 5 months ago
- Severity changed from Major - prevents use of part of Rudder | no simple workaround to Minor - inconvenience | misleading | easy workaround
- Effort required set to Very Small
- Priority changed from 0 to 33
Nicolas CHARLES wrote:
I'm improving priority, as it wrongly says something is broken, when it is not
That is the exact definition of "misleading", so requalifying as a minor bug - our focus must remain with priority on bugs that break something. This remains important, and is quite confusing, but quick to fix, so I've set it to a "very small", which means we'll get to it faster.
#7 Updated by Jonathan CLARKE 5 months ago
- Subject changed from When in changes only mode, there is not start/end reports, and agent output returns a fatal error to When in changes only mode, with no heartbeat, 'rudder agent run' outputs 'error: Rudder agent was interrupted during execution by a fatal error.'
- Description updated (diff)
Updated description to match tests we did.
#16 Updated by Benoît PECCATTE 2 months ago
For 3.1 we should be able to extract the information directly from the technique.
Since 3.1 is in maintenance mode, it shouldn't change a lot.
So extracting the value will solve the problem without too much work.
Solutions: grep on thye technique, or write to a file directly in the technique.
#20 Updated by Alexis MOUSSET 27 days ago
- Status changed from In progress to Pending technical review
- Assignee changed from Alexis MOUSSET to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/rudder-agent/pull/129
#21 Updated by Alexis MOUSSET 25 days ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder-agent|fed7991ddedcac7ee35d189d5c4d63d18d9e8661.
#22 Updated by Vincent MEMBRÉ 12 days ago
- Priority changed from 66 to 65