Skip to content

Bug: [db_migrator] parse_xml fails when minigraph has SonicQosProfile #22120

@ganglyu

Description

@ganglyu

Is it platform specific

generic

Importance or Severity

Critical

Description of the bug

https://github.com/sonic-net/sonic-utilities/blob/master/scripts/db_migrator.py#L138
try:
if os.path.isfile(MINIGRAPH_FILE):
minigraph_data = parse_xml(MINIGRAPH_FILE)
except Exception as e:
log.log_error('Caught exception while trying to parse minigraph: ' + str(e))
pass
If there's SonicQosProfile in minigraph, parse_xml fails, because select_mmu_profiles needs platform.
https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-config-engine/minigraph.py#L1925

Steps to Reproduce

Add SonicQosProfile, warm upgrade from 202305 to 202405:
<a:DeviceProperty>
<a:Name>SonicQosProfile</a:Name>
<a:Reference i:nil="true"/>
<a:Value>Balanced</a:Value>
</a:DeviceProperty>

Actual Behavior and Expected Behavior

2025-01-29T19:00:46.000057+00:00 sonic db_migrator: Caught exception while trying to parse minigraph: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'
2025-01-29T19:00:46.000057+00:00 sonic db_migrator: Caught exception while trying to parse minigraph: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'
2025-01-29T19:00:46.006286+00:00 sonic db_migrator: Migrate GNMI configuration
2025-01-29T19:00:46.006286+00:00 sonic db_migrator: Migrate GNMI configuration
2025-01-29T19:00:46.024238+00:00 sonic db_migrator: Asic Type: broadcom, Hwsku: Arista-7060CX-32S-D48C8
2025-01-29T19:00:46.024238+00:00 sonic db_migrator: Asic Type: broadcom, Hwsku: Arista-7060CX-32S-D48C8
2025-01-29T19:00:46.041495+00:00 sonic db_migrator: Migrate TACPLUS configuration
2025-01-29T19:00:46.041495+00:00 sonic db_migrator: Migrate TACPLUS configuration
2025-01-29T19:00:46.041623+00:00 sonic db_migrator: Migrate AAA configuration
2025-01-29T19:00:46.041623+00:00 sonic db_migrator: Migrate AAA configuration

Relevant log output

Output of show version, show techsupport

Attach files (if any)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions