Project

General

Profile

Actions

Bug #17373

closed

Bug #17341: Compliance data for reporting plugin are not generated anymore

duplicates entries when saving node compliance levels

Added by Vincent MEMBRÉ almost 4 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Error - Next version
Regression:

Description

There was a bug in the resolution of #17341

We insert already inserted node compliance levels:

We have a log a each agent run:

[2020-05-11 12:56:34+0200] ERROR report - Error when saving node compliances: Batch entry 0 insert into nodecompliancelevels (nodeid,runtimestamp,ruleid,directiveid,pending,success,repaired,error,unexpected,missing,noanswer,notapplicable,reportsdisabled,compliant,auditnotap...
[2020-05-11 12:56:34+0200] ERROR report.cache - Error when updating compliance cache for nodes: [root]: SystemError: Batch entry 0 insert into nodecompliancelevels (nodeid,runtimestamp,ruleid,directiveid,pending,success,repaired,error,unexpected,missing,noanswer,notapplicable,reportsdisabled,compliant,auditnotapplicable,noncompliant,auditerror,badpolicymode)
 values ( 'root','2020-05-11 12:50:39+02','server-roles','serve…

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #17410: Error log about duplicates entries when saving node compliance levelsReleasedVincent MEMBRÉActions
Related to Rudder - Bug #17401: Error logs about duplicated entries to nodeComplianceLevel after policy generation. ResolvedActions
Actions #1

Updated by Vincent MEMBRÉ almost 4 years ago

  • Status changed from New to In progress
  • Assignee set to Vincent MEMBRÉ
Actions #2

Updated by Vincent MEMBRÉ almost 4 years ago

  • Assignee changed from Vincent MEMBRÉ to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/2964
Actions #3

Updated by Vincent MEMBRÉ almost 4 years ago

  • Status changed from In progress to Pending release
Actions #4

Updated by Vincent MEMBRÉ almost 4 years ago

  • Description updated (diff)
Actions #5

Updated by Vincent MEMBRÉ almost 4 years ago

  • Fix check changed from To do to Checked
Actions #6

Updated by Nicolas CHARLES almost 4 years ago

  • Fix check changed from Checked to Error - Blocking

I still have the error messages

[2020-05-14 11:02:27+0200] INFO  policy.generation - Successful policy update '10' [started 2020-05-14 11:02:26 - ended 2020-05-14 11:02:27]
[2020-05-14 11:02:27+0200] INFO  policy.generation - Start policy generation, checking updated rules
[2020-05-14 11:02:27+0200] ERROR report - Error when saving node compliances: Batch entry 0 insert into nodecompliancelevels (nodeid,runtimestamp,ruleid,directiveid,pending,success,repaired,error,unexpected,missing,noanswer,notapplicable,reportsd
isabled,compliant,auditnotap...
[2020-05-14 11:02:27+0200] ERROR report.cache - Error when updating compliance cache for nodes: [65e2eb84-5bc5-4edb-a479-fd618b0a3de4]: SystemError: Batch entry 0 insert into nodecompliancelevels (nodeid,runtimestamp,ruleid,directiveid,pending,success,repaired,error,unexpected,missing,noanswer,notapplicable,reportsdisabled,compliant,auditnotapplicable,noncompliant,auditerror,badpolicymode)
 values ( '65e2eb84-5bc5-4edb-a479-fd618b0a3de4','2020-05-14 10:58:20+02','inventory-all','inventory-all',0,1,0,0,0,0,0,0,0,0,0,0,0,0 ) was aborted: ERROR: duplicate key value violates unique constraint "nodecompliancelevels_pkey" 
  Detail: Key (nodeid, runtimestamp, ruleid, directiveid)=(65e2eb84-5bc5-4edb-a479-fd618b0a3de4, 2020-05-14 10:58:20+02, inventory-all, inventory-all) already exists.  Call getNextException to see other errors in the batch.; cause was: java.sql.BatchUpdateException: Batch entry 0 insert into nodecompliancelevels (nodeid,runtimestamp,ruleid,directiveid,pending,success,repaired,error,unexpected,missing,noanswer,notapplicable,reportsdisabled,compliant,auditnotapplicable,noncompliant,auditerror,badpolicymode)
 values ( '65e2eb84-5bc5-4edb-a479-fd618b0a3de4','2020-05-14 10:58:20+02','inventory-all','inventory-all',0,1,0,0,0,0,0,0,0,0,0,0,0,0 ) was aborted: ERROR: duplicate key value violates unique constraint "nodecompliancelevels_pkey" 
  Detail: Key (nodeid, runtimestamp, ruleid, directiveid)=(65e2eb84-5bc5-4edb-a479-fd618b0a3de4, 2020-05-14 10:58:20+02, inventory-all, inventory-all) already exists.  Call getNextException to see other errors in the batch. 
 -> 
[2020-05-14 11:02:27+0200] INFO  policy.generation - [metrics] Xmx:1015 MB nodes:3 (cached:3) rules:5 (enabled:5) techniques:44 (enabled:44) directives:6 (enabled:6) groups:6 (dynamic:6) parameters:1
[2020-05-14 11:02:27+0200] INFO  policy.generation - No node configuration was updated, no policies to write

Actions #7

Updated by François ARMAND almost 4 years ago

  • Fix check changed from Error - Blocking to Error - Next version

After discussion, it seems that these problem are just an error without bad consequence beside a very bad looking log. We will correct it 6.1 because it needs some work.

Actions #8

Updated by François ARMAND almost 4 years ago

  • Related to Bug #17410: Error log about duplicates entries when saving node compliance levels added
Actions #9

Updated by Vincent MEMBRÉ almost 4 years ago

This bug has been fixed in Rudder 6.0.6 which was released today.

Actions #10

Updated by Vincent MEMBRÉ almost 4 years ago

  • Status changed from Pending release to Released
Actions #11

Updated by François ARMAND almost 4 years ago

  • Related to Bug #17401: Error logs about duplicated entries to nodeComplianceLevel after policy generation. added
Actions

Also available in: Atom PDF