Actions
Bug #17401
closedError logs about duplicated entries to nodeComplianceLevel after policy generation.
Status:
Resolved
Priority:
N/A
Assignee:
-
Category:
Web - Compliance & node report
Target version:
Pull Request:
Severity:
Trivial - no functional impact | cosmetic
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
28
Name check:
To do
Fix check:
Error - Blocking
Regression:
Description
Since we empty compliance cache during policy generation, after policy generation, we rebuild almost immediatly a new compliance cache with the same value as we had before and thus we insert compliance we have already inserted.
However, it has no impact on Rudder, compliance is ok and nothing else is happening.
[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