Report tool traceback on utf-8 decode

Bug #2067952 reported by Eric MacDonald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Undecided
Unassigned

Bug Description

Brief Description
-----------------
The Report Tool did a utf-8 UnicodeDecodeError traceback while analyzing a bundle.

Code should have a try/except block in this path.

Severity
--------
Major if it happens.

Steps to Reproduce
------------------
report.py -d <path to bundle>

Expected Behavior
------------------
Report analysis completes without execution error.

Actual Behavior
----------------
Report analysis is incomplete.

Reproducibility
---------------
Seen on one collect bundle.

System Configuration
--------------------
suspect System Controller

Branch/Pull Time/Commit
-----------------------
Any prior to this issue being resolved. June 4th, 2024 time frame.

Last Pass
---------
Tool needs to handle string parsing case better

Timestamp/Logs
--------------
Traceback (most recent call last):
  File "/folk/cgts/tools/report/report.py", line 907, in <module>
    engine.execute(plugins, output_dir)
  File "/folk/cgts/tools/report/execution_engine.py", line 382, in execute
    plugin.state["exclude"]),
  File "/folk/cgts/tools/report/plugin_algs/daemon_failures.py", line 40, in daemon_failures
    data = substring(start, end, daemon_substrings, daemon_files, exclude_list)
  File "/folk/cgts/tools/report/plugin_algs/substring.py", line 59, in substring
    status = _continue(start, end, file)
  File "/folk/cgts/tools/report/plugin_algs/substring.py", line 140, in _continue
    line = f.readline()
  File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6363: ordinal not in range(128)

Test Activity
-------------
PV

Workaround
----------
Analyze bundle manually.
No easy workaround.
Issue will be fixed soon. Pull new content.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to utilities (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/921081

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to utilities (master)

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/921081
Committed: https://opendev.org/starlingx/utilities/commit/a7c75ad8de4cff920de7fd83752e3fd7cec4e36c
Submitter: "Zuul (22348)"
Branch: master

commit a7c75ad8de4cff920de7fd83752e3fd7cec4e36c
Author: Eric MacDonald <email address hidden>
Date: Mon Jun 3 17:25:50 2024 -0400

    Fix utf-8 decode traceback in the report tool strings algorithm

    This update adds a try or except on UnicodeDecodeError to the
    utf-8 decode case in the _evaluate_substring function of the
    strings algorithm.

    Added a dropped logs file to record a list of logs that fail the utf-8
    conversion. The dropped logs file is stored as dropped_logs in the
    report analysis plugins output folder.

    Test Plan:

    PASS: Verify on collect bundle that exhibited the issue.
    PASS: Verify dropped logs are recorded in new
          report_analysis/plugins/dropped_logs file.
    PASS: Verify no newly introduced pep8 errors or warnings.

    Closes-Bug: 2067952
    Change-Id: I82cecd6bb537a459255467f6ced7e742c5771d97
    Signed-off-by: Eric MacDonald <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.