Project

General

Profile

Actions

Bug #26483

open

Error when trying to add a node property when “Change audit logs” are mandatory

Added by Michel BOUISSOU about 1 month ago. Updated 9 days ago.

Status:
Pending release
Priority:
1 (highest)
Category:
-
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
I dislike using that feature
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
56
Name check:
To do
Fix check:
To do
Regression:
No

Description

Rudder 8.2.5

If both “Enable change audit logs” and “Make logs messages mandatory” are checked in Rudder server config, then trying to add a node property in the node's properties page results in error message : « Error when Saving node propertie, details : The server had a problem, try again later »

The webapp log shows :

INFO  api-processing.response-error - An error occurred while updating Node 'fc726a00-dfe8-497a-b1c1-8543d3468c94'; cause was: There was an error while extracting reason message; cause was: Inconsistency: Reason field is mandatory and should be at least 5 characters long

Making the audit log messages non mandatory solves this.


Subtasks 1 (0 open1 closed)

Bug #26616: Upmerge need spotless fixReleasedFrançois ARMANDActions

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #10578: Cannot add node property when audit message is mandatoryReleasedNicolas CHARLESActions
Actions #1

Updated by Nicolas CHARLES about 1 month ago

  • Related to Bug #10578: Cannot add node property when audit message is mandatory added
Actions #2

Updated by François ARMAND about 1 month ago

We used to have a default message automatically added in that case, see correction in 4.1: https://github.com/Normation/rudder/pull/1627/files

Actions #3

Updated by François ARMAND about 1 month ago

  • Assignee set to Clark ANDRIANASOLO
  • Priority changed from To review to 1 (highest)

It's P1 because the only workaround is to disable the audit message which is often a mandatory requirement in Big Companies

Actions #4

Updated by Clark ANDRIANASOLO about 1 month ago

  • Status changed from New to In progress
Actions #5

Updated by Clark ANDRIANASOLO about 1 month ago

  • Status changed from In progress to New

This happens on every attempt to update properties (adding one, removing one, deleting one from the UI, in fact it is the same POST /api/nodes/{node_id} in the API, which suffers from the same problem).

From the groups page, it works though (and it is also a "group update" in the REST API)

But in the request, there is a reason field in the API request from both places, so it is likely a problem in the Node API only, which expects a mandatory reason :

>>> curl  -X POST  -H "X-API-TOKEN: $(cat /var/rudder/run/api-token)" http://localhost:8081/rudder/api/latest/nodes/root -H "Content-Type: application/json" --data '{"properties":[{"name":"audit","value":"testtest"}],"reason":"ras"}'
{"action":"updateNode","result":"error","errorDetails":"An error occurred while updating Node 'root'; cause was: There was an error while extracting reason message; cause was: Inconsistency: Reason field is mandatory and should be at least 5 characters long"}

Actions #6

Updated by Clark ANDRIANASOLO about 1 month ago · Edited

It does not cause an issue in the groups API, nor directives and rules APIs, that seem to ignore the reason field.

But there are several inconsistencies in the Rudder UI which need to be fixed too, or else the mandatory checks will be bypassed :
  • groups can be created without a reason field (defaults as empty string)
  • rules do not validate the reason length (it needs to be at least 5 chars long), but prevents saving by disabling the button if the field is empty (allows it when field is blank, it does not seem to trim whitespaces from the string)
Actions #7

Updated by Clark ANDRIANASOLO about 1 month ago

  • Status changed from New to Pending technical review
  • Pull Request set to https://github.com/Normation/rudder/pull/6233
Actions #8

Updated by Clark ANDRIANASOLO 26 days ago

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

Updated by Clark ANDRIANASOLO 25 days ago

  • Subtask #26616 added
Actions

Also available in: Atom PDF