Bug 1928073

Summary: Node exporter reports text format parsing error in line 3: invalid escape sequence
Product: OpenShift Container Platform Reporter: Dhruv Gautam <dgautam>
Component: MonitoringAssignee: Pawel Krupa <pkrupa>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: low Docs Contact:
Priority: low    
Version: 4.6CC: alegrand, anpicker, dahernan, dcritch, erooth, hongyli, juzhao, kakkoyun, lcosic, pkrupa, spasquie
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-20 11:52:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1917683    
Bug Blocks:    

Description Dhruv Gautam 2021-02-12 10:17:47 UTC
Description of problem:
node exporter has parsing error

$ oc logs node-exporter-22bcr -c node-exporter --tail=10
level=error ts=2021-02-11T09:29:30.826Z caller=textfile.go:209 collector=textfile msg="failed to collect textfile data" file=virt.prom err="failed to parse textfile data from \"/var/node_exp
orter/textfile/virt.prom\": text format parsing error in line 3: invalid escape sequence '\\,'"
level=error ts=2021-02-11T09:29:37.367Z caller=textfile.go:209 collector=textfile msg="failed to collect textfile data" file=virt.prom err="failed to parse textfile data from \"/var/node_exp
orter/textfile/virt.prom\": text format parsing error in line 3: invalid escape sequence '\\,'"
level=error ts=2021-02-11T09:29:45.826Z caller=textfile.go:209 collector=textfile msg="failed to collect textfile data" file=virt.prom err="failed to parse textfile data from \"/var/node_exp
orter/textfile/virt.prom\": text format parsing error in line 3: invalid escape sequence '\\,'"
level=error ts=2021-02-11T09:29:52.365Z caller=textfile.go:209 collector=textfile msg="failed to collect textfile data" file=virt.prom err="failed to parse textfile data from \"/var/node_exp
orter/textfile/virt.prom\": text format parsing error in line 3: invalid escape sequence '\\,'"

Found 2 bugzillas for the same issue which were reported for 4.3 and 4.4 respectively.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1841150
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1775454

Version-Release number of selected component (if applicable):
RHOCP 4.6.15

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
level=error ts=2021-02-11T09:29:30.826Z caller=textfile.go:209 collector=textfile msg="failed to collect textfile data" file=virt.prom err="failed to parse textfile data from \"/var/node_exp
orter/textfile/virt.prom\": text format parsing error in line 3: invalid escape sequence '\\,'"


Expected results:
No such error should be there.

Additional info:

Comment 2 Lili Cosic 2021-02-18 09:29:14 UTC
*** Bug 1929896 has been marked as a duplicate of this bug. ***

Comment 5 hongyan li 2021-03-02 03:59:45 UTC
This bug is for 4.6.z

Comment 8 Junqi Zhao 2021-03-22 02:42:17 UTC
tested with 4.6.0-0.nightly-2021-03-21-131139, see from Comment 1
the fix is better change from
echo "${line//\\/ }" >>"${v}"
to
echo "${line//\\/}" >>"${v}"

Comment 9 Junqi Zhao 2021-04-14 04:36:49 UTC
tested with the not merged PR, issue is fixed

Comment 14 errata-xmlrpc 2021-05-20 11:52:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6.29 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1521