Project

General

Profile

Actions

Bug #27087

closed

rudder agent run output exit code 0 when in initial policies and cannot update from the server

Added by Nicolas CHARLES about 1 month ago. Updated 10 days ago.

Status:
Rejected
Priority:
2
Category:
Agent
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

If a node is in initial policy mode and cannot update from the server (because it is not accepted or ignored), then the exit code is 0
The same node, with non initial policy, would output exit code 2

As a result, running `rudder agent reset` effectively makes the node always exit 0 rather than the expected 2

Actions #1

Updated by François ARMAND 24 days ago

  • Assignee set to Alexis Mousset
  • Priority changed from To review to 1 (highest)
Actions #2

Updated by François ARMAND 24 days ago

  • Priority changed from 1 (highest) to 2
Actions #3

Updated by Alexis Mousset 24 days ago

  • Status changed from New to In progress
Actions #4

Updated by Alexis Mousset 10 days ago

  • Status changed from In progress to New
Actions #5

Updated by Alexis Mousset 10 days ago

  • Status changed from New to Rejected

This behavior is actually intentional.

In #20996 we changed the logic to exit with 0 in this case:

elif [ $code -eq 1 ]; then
  printf "${GREEN}ok${NORMAL}: Rudder node waiting to be accepted.\n" 
  exit 0

On the node side there is no way to make a difference between a node not yet accepted or ignored, and the former is more common.

The workaround is to grep the error in the output. Closing this issue.

Actions

Also available in: Atom PDF