Bug 2091084 - insights-client fails to parse non-alphanumeric character in yum repository file
Summary: insights-client fails to parse non-alphanumeric character in yum repository file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Hybrid Cloud Console (console.redhat.com)
Classification: Red Hat
Component: Insights - Core Data Collection
Version: unspecified
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Xiangce Liu
QA Contact:
URL:
Whiteboard:
: 2131025 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-27 14:31 UTC by achadha
Modified: 2023-02-13 00:25 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-13 00:25:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 6964423 0 None None None 2022-06-22 17:12:44 UTC

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. ***


Note You need to log in before you can comment on or make changes to this bug.