[action] [PR:4229] Fix dump port state CLI command crash on multi-asic platforms#4276
Merged
mssonicbld merged 1 commit intosonic-net:202511from Feb 13, 2026
Merged
Conversation
#### What I did
Currently `sudo dump state -d APPL_DB -n asic0 port Ethernet16` CLI command crashes on multi-asic platforms.
The error occurs because the code checks if any database configuration is initialized and loaded which is falsy value on multi-asic system. This results in following runtime error:
```
RuntimeError: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig.
```
The multi-ASIC platforms specifically needs the global database configuration to be initialized. The pull request fixes the condition on loading expected database configuration based on single or multi-asic system.
#### How I did it
Fixed it by using isGlobalInit() check for multi-asic and isInit() for single-asic to ensure the correct DB configuration is loaded before creating connectors.
#### How to verify it
Verified on single and multi-asic linecard. After fix, dump port state command no longer result in a crash and returns the expected results.
#### Previous command output (if the output of a command-line utility has changed)
#### New command output (if the output of a command-line utility has changed)
#### Command output after fix
```
sudo dump state -d APPL_DB -n asic0 port Ethernet16
{
"Ethernet16": {
"APPL_DB": {
"keys": [
{
"PORT_TABLE:Ethernet16": {
"admin_status": "up",
"alias": "etp3",
"asic_port_name": "Eth16",
"core_id": "1",
"core_port_id": "3",
"description": "Ethernet16-connected-to-@Ethernet4/1",
"fec": "rs",
"flap_count": "1",
"index": "3",
"lanes": "88,89,90,91,92,93,94,95",
"last_up_time": "Mon Jan 26 22:11:46 2026",
"mtu": "9100",
"num_voq": "8",
"oper_status": "up",
"pfc_asym": "off",
"role": "Ext",
"speed": "400000",
"tpid": "0x8100"
}
}
],
"tables_not_found": []
}
}
}
```
Requesting to backport this fix to 202511 and msft-202503
Collaborator
Author
|
Original PR: #4229 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Currently
sudo dump state -d APPL_DB -n asic0 port Ethernet16CLI command crashes on multi-asic platforms.The error occurs because the code checks if any database configuration is initialized and loaded which is falsy value on multi-asic system. This results in following runtime error:
The multi-ASIC platforms specifically needs the global database configuration to be initialized. The pull request fixes the condition on loading expected database configuration based on single or multi-asic system.
How I did it
Fixed it by using isGlobalInit() check for multi-asic and isInit() for single-asic to ensure the correct DB configuration is loaded before creating connectors.
How to verify it
Verified on single and multi-asic linecard. After fix, dump port state command no longer result in a crash and returns the expected results.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Command output after fix
Requesting to backport this fix to 202511 and msft-202503