Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2091084

Summary: insights-client fails to parse non-alphanumeric character in yum repository file
Product: Red Hat Hybrid Cloud Console (console.redhat.com) Reporter: achadha
Component: Insights - Core Data CollectionAssignee: Xiangce Liu <xialiu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: bfahr, fjansen, jangerrit.kootstra, jiazhang, klape, lphiri, miclark, rblakley, robwilli, sbunciak, xialiu, zzhou
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-13 00:25:57 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:

Description achadha 2022-05-27 14:31:34 UTC
Description of problem:

insights-client fails to parser yum repolist: Line containing 'repo id' was not found in table when a repoid contains a non-alphanumeric character
And gives the below error:

Traceback (most recent call last):
  File "/var/lib/insights/last_stable.egg/insights/parsers/yum.py", line 149, in parse_content
    empty_exception=True)
  File "/var/lib/insights/last_stable.egg/insights/parsers/__init__.py", line 357, in parse_fixed_table
    first_line = calc_offset(table_lines, heading_ignore)
  File "/var/lib/insights/last_stable.egg/insights/parsers/__init__.py", line 291, in calc_offset
    raise ValueError("Line containing '{}' was not found in table".format(','.join(target)))
ValueError: Line containing 'repo id' was not found in table

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/insights/last_stable.egg/insights/core/dr.py", line 967, in run
    result = DELEGATES[component].process(broker)
  File "/var/lib/insights/last_stable.egg/insights/core/dr.py", line 686, in process
    return self.invoke(broker)
  File "/var/lib/insights/last_stable.egg/insights/core/plugins.py", line 130, in invoke
    return self.component(dep_value)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 598, in __init__
    super(CommandParser, self).__init__(context)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 91, in __init__
    self._handle_content(context)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 94, in _handle_content
    self.parse_content(context.content)
  File "/var/lib/insights/last_stable.egg/insights/parsers/yum.py", line 152, in parse_content
    raise ParseException('Failed to parser yum repolist: {0}'.format(str(e)))
insights.parsers.ParseException: Failed to parser yum repolist: Line containing 'repo id' was not found in table



Version-Release number of selected component (if applicable):
insights-client

How reproducible:


Steps to Reproduce:
1. create a yum.repo file with non-alphanumeric character on the system
2. Register the system to insights-client
3. Or run insights-client command

Actual results:
insights-client command fails if there is a non-alphanumeric character 

Expected results:
insights-client command should not fail

Additional info:

Yum is able to parse the repo file with non-alphanumeric character, then insights-client should also be able to parse the same as per customer

Comment 2 ir. Jan Gerrit Kootstra 2022-07-21 22:52:44 UTC
The knowledges base solution is nice, but it suggests the customer has to solve an issue caused by a vendor.
Each time a vendor publishes a new version of the rpm containing the repo file the customers needs to manually fix the issues.

Yum and DNF are abble to handle the characers, but the insights-client does not.

Comment 5 ir. Jan Gerrit Kootstra 2022-08-26 06:56:39 UTC
The reasoning behind this request: I found that vendors like Intel put the trademark "character" in the repository names.

Each time they provide a new repo file users of RHEL would have to manually remove the trademark "character" from the repo file, if not Insights would crash.

Comment 9 mabezerr 2022-10-06 17:17:46 UTC
*** Bug 2131025 has been marked as a duplicate of this bug. ***