Project

General

Profile

Bug #11047

rudder agent update -q bad exit code

Added by Janos Mattyasovszky 3 months ago. Updated about 1 month ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Target version (plugin):
Severity:
Minor - inconvenience | misleading | easy workaround
User visibility:
Effort required:
Priority:
0

Description

If you run rudder agent run -q, it exits 1, so you cannot use it to check silently if it succeeded or not.

Additionally, it also reports OK with exit code 0if you run it without -q but it is not able to update the policies:

# rudder agent update
R: *********************************************************************************
* rudder-agent could not get an updated configuration from the policy server.   *
* This can be caused by:                                                        *
*   * a networking issue                                                        *
*   * an unavailable server                                                     *
*   * if the node's IP in not if the allowed networks of its policy server.     *
* Any existing configuration policy will continue to be applied without change. *
*********************************************************************************
ok: Rudder agent promises were updated.
# echo $?
0

This is unusable in this way for anything other than human interpretation or grepping for the error report in the output.

It would be nice if the return code would represent the success of the update.

found on rudder-agent-4.1.5.release-1.SLES.11


Subtasks

Bug #11048: Rudder agent update ruturns 0 even if update failsNew

Associated revisions

Revision 0d98103f
Added by Benoît PECCATTE 3 months ago

Fixes #11047: rudder agent update -q bad exit code

History

#1 Updated by Janos Mattyasovszky 3 months ago

  • Description updated (diff)

#2 Updated by Benoît PECCATTE 3 months ago

  • Target version set to 3.1.22

#3 Updated by Benoît PECCATTE 3 months ago

  • Status changed from New to In progress
  • Assignee set to Benoît PECCATTE

#4 Updated by Benoît PECCATTE 3 months ago

  • Target version changed from 3.1.22 to 357

#5 Updated by Benoît PECCATTE 3 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Benoît PECCATTE to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-agent/pull/119

#6 Updated by Janos Mattyasovszky 3 months ago

just wow.

#7 Updated by Benoît PECCATTE 3 months ago

Opening a sub task for the exit 0 since it's a cfengine problem, harder to fix.

#8 Updated by Benoît PECCATTE 3 months ago

just wow.

Pure luck!

#9 Updated by Benoît PECCATTE 3 months ago

  • Status changed from Pending technical review to Pending release

#10 Updated by Alexis MOUSSET 3 months ago

  • Target version changed from 357 to 4.1.6

#11 Updated by Vincent MEMBRÉ about 1 month ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.6 and 4.2.0~beta3 which were released today.

Also available in: Atom PDF