Project

General

Profile

Bug #14692

Rudder agent check does not repair policies if they are broken

Added by Nicolas CHARLES 3 months ago. Updated 2 months ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
User visibility:
Effort required:
Priority:
0

Description

I volontarly corrupted policies and ran rudder agent check

Output is

# rudder agent check
WARNING: No disable file detected and no agent executor process either. Restarting agent service...ok: stop service rudder-agent succeeded
ok: start service rudder-agent succeeded
 Done
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: syntax error
iii
   ^
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: Expected 'bundle' or 'body' keyword, wrong input 'iii'
iii
   ^
   error: There are syntax errors in policy files
ok: Rudder agent check ran without errors.

cf-promises does return exit code 1, but

# /var/rudder/cfengine-community/bin/cf-promises | grep error
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: syntax error
iii
   ^
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: Expected 'bundle' or 'body' keyword, wrong input 'iii'
iii
   ^
   error: There are syntax errors in policy files
root@agent1:/home/vagrant# echo $?
1

errors are now in stderr rather than in stdout, so grep fails (but we could get exit code)

we could also use stderr in

# /var/rudder/cfengine-community/bin/cf-promises 2>&1  | grep error
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: syntax error
/var/rudder/cfengine-community/inputs/promises.cf:18:4: error: Expected 'bundle' or 'body' keyword, wrong input 'iii'
   error: There are syntax errors in policy files
root@agent1:/home/vagrant# echo $?
0


Related issues

Related to Rudder - Bug #14171: 'rudder-cf-execd' and 'rudder-cf-serverd' in status 'inactive (dead)'RejectedActions
Related to Rudder - Bug #14061: Agent run errors are not outputed on stderr anymoreReleasedActions
Related to Rudder - Bug #14853: If policies are broken on the Rudder Server Root, they won't be repaired until a new policy generation NewActions

Associated revisions

Revision b7772861 (diff)
Added by Nicolas CHARLES 3 months ago

Fixes #14692: rudder agent check does not repair policies if they are broken

History

#1

Updated by Nicolas CHARLES 3 months ago

  • Related to Bug #14171: 'rudder-cf-execd' and 'rudder-cf-serverd' in status 'inactive (dead)' added
#2

Updated by Nicolas CHARLES 3 months ago

  • Related to Bug #14061: Agent run errors are not outputed on stderr anymore added
#3

Updated by Nicolas CHARLES 3 months ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
#4

Updated by Nicolas CHARLES 3 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-agent/pull/209
#5

Updated by Nicolas CHARLES 3 months ago

  • Target version changed from 5.0.10 to 4.3.12
#6

Updated by Nicolas CHARLES 3 months ago

  • Pull Request changed from https://github.com/Normation/rudder-agent/pull/209 to https://github.com/Normation/rudder-agent/pull/210
#7

Updated by Rudder Quality Assistant 3 months ago

  • Assignee changed from Alexis MOUSSET to Nicolas CHARLES
#8

Updated by Nicolas CHARLES 3 months ago

  • Status changed from Pending technical review to Pending release
#9

Updated by Nicolas CHARLES 2 months ago

  • Related to Bug #14853: If policies are broken on the Rudder Server Root, they won't be repaired until a new policy generation added
#10

Updated by Vincent MEMBRÉ 2 months ago

  • Subject changed from rudder agent check does not repair policies if they are broken to Rudder agent check does not repair policies if they are broken
#11

Updated by Vincent MEMBRÉ 2 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.3.12 and 5.0.10 which were released today.

Also available in: Atom PDF