Actions
Bug #26290
closedThe relayd reports parser can break on multiline fields in logs
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
No
Description
There are 3 broken reports after a debious log:
E| compliant upgrade_rudder_agent_on_| 30 - Determine RedHat ve| version Set the string redhat.version to the output of 'awk 'BEGIN{ FS = "=" } /^VERSION=/{ print $2 }' /etc/os-release | grep -E -o "[0-9.]+"' was correct 2025-01-31T16:57:59+00:00 R: The 'awk 'BEGIN{ FS = "=" } /^VERSION=/{ print $2 }' /etc/os-release | grep -E -o "[0-9.]+"' command returned '15 2025-01-31T16:57:59+00:00 4' 2025-01-31T16:57:59+00:00 R: @@upgrade_rudder_agent_on_redhat_families@@log_info@@740c5a88-e56f-4955-9a8f-3a6a1975c925@@c843af2b-7b80-464c-979c-48238b40645d@@8eb7e5fa-eb62-4fad-b03a-7c28f6d343db@@40-10 - Rudder public repository set to repository.rudder.io for OS 15 2025-01-31T16:57:59+00:00 4 with Rudder 8.2@@/etc/yum.repos.d/rudder.repo@@2025-01-31 16:57:58+00:00##e12ae89a-7463-45fc-b0d2-b0e65f7d181c@#Build file /etc/yum.repos.d/rudder.repo from mustache type template /var/rudder/cfengine-community/inputs/upgrade_rudder_agent_on_redhat_families/1.0/resources/rudder.public.repo.tpl was correct 2025-01-31T16:57:59+00:00 R: @@upgrade_rudder_agent_on_redhat_families@@result_success@@740c5a88-e56f-4955-9a8f-3a6a1975c925@@c843af2b-7b80-464c-979c-48238b40645d@@8eb7e5fa-eb62-4fad-b03a-7c28f6d343db@@40-10 - Rudder public repository set to repository.rudder.io for OS 15 2025-01-31T16:57:59+00:00 4 with Rudder 8.2@@/etc/yum.repos.d/rudder.repo@@2025-01-31 16:57:58+00:00##e12ae89a-7463-45fc-b0d2-b0e65f7d181c@#Build file /etc/yum.repos.d/rudder.repo from mustache template /var/rudder/cfengine-community/inputs/upgrade_rudder_agent_on_redhat_families/1.0/resources/rudder.public.repo.tpl was correct 2025-01-31T16:57:59+00:00 R: @@upgrade_rudder_agent_on_redhat_families@@result_na@@740c5a88-e56f-4955-9a8f-3a6a1975c925@@c843af2b-7b80-464c-979c-48238b40645d@@5de65f37-e442-4201-bc7d-567125891616@@40-20 - Rudder private repository set to repository.rudder.io for OS 15 2025-01-31T16:57:59+00:00 4 with Rudder 8.2@@/etc/yum.repos.d/rudder.repo@@2025-01-31 16:57:58+00:00##e12ae89a-7463-45fc-b0d2-b0e65f7d181c@#Skipping method 'File from a mustache template' with key parameter '/etc/yum.repos.d/rudder.repo' since condition 'redhat_rudder_password_provided_true' is not reached was not applicable info upgrade_rudder_agent_on_| 50 - Rudder repository f| /etc/yum.repos.d/| Ensure permissions mode 644, owner root and group root on /etc/yum.repos.d/rudder.repo on type all with 0 recursion level was correct E| compliant upgrade_rudder_agent_on_| 50 - Rudder repository f| /etc/yum.repos.d/| Ensure permissions mode 644, owner root and group root on /etc/yum.repos.d/rudder.repo was correct
Files
Updated by Elaad FURREEDAN about 2 months ago
- Priority changed from N/A to To review
Updated by Nicolas CHARLES about 2 months ago
- Assignee set to Alexis Mousset
- Priority changed from To review to 1 (highest)
It is a multi-line because the variable value is
15
But we should support that gracefully
Updated by Alexis Mousset about 2 months ago
- Status changed from New to In progress
Updated by Alexis Mousset about 2 months ago
· Edited
- File clipboard-202502061427-8q1hx.png clipboard-202502061427-8q1hx.png added
- Status changed from In progress to New
The problem
The variable from command method produces a variable containing
15 4
for which the reporting works correctly. The value is then used as component for other methods, which break. The awk parser only handles multiline values for the message field, not others:
2025-01-31T16:57:59+00:00 R: @@upgrade_rudder_agent_on_redhat_families@@log_info@@740c5a88-e56f-4955-9a8f-3a6a1975c925@@c843af2b-7b80-464c-979c-48238b40645d@@8eb7e5fa-eb62-4fad-b03a-7c28f6d343db@@40-10 - Rudder public repository set to repository.rudder.io for OS 15 2025-01-31T16:57:59+00:00 4 with Rudder 8.2@@/etc/yum.repos.d/rudder.repo@@2025-01-31 16:57:58+00:00##e12ae89a-7463-45fc-b0d2-b0e65f7d181c@#Build file /etc/yum.repos.d/rudder.repo from mustache type template /var/rudder/cfengine-community/inputs/upgrade_rudder_agent_on_redhat_families/1.0/resources/rudder.public.repo.tpl was correct
On the relayd/server side, the line is parsed almost correctly (here with 15\n1
):
The date is not removed from the beginning of the line.
What to do
- We will fix the parsing problem in relayd to handle the value correctly.
- On the awk side, a fix would require a massive change in how reports are parsed. This code is old and comes with absolutely no tests, so it would also be quite risky.
Updated by Alexis Mousset about 2 months ago
- Status changed from New to In progress
Updated by Alexis Mousset about 2 months ago
- Status changed from In progress to Pending technical review
- Assignee changed from Alexis Mousset to Félix DALLIDET
- Pull Request set to https://github.com/Normation/rudder/pull/6162
Updated by Alexis Mousset about 2 months ago
- Subject changed from The awk reports parser can break on multiline logs to The relayd reports parser can break on multiline fields in logs
Updated by Alexis Mousset about 2 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|81e95a73bb49b4fc76cd587f80afd7a5c33d28c8.
Updated by Alexis Mousset about 1 month ago
- Fix check changed from To do to Checked
Updated by Vincent MEMBRÉ about 1 month ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 8.1.12 and 8.2.5 which were released today.
Actions