Skip to content

Fix CHASSIS_STATE_DB errors on non-chassis platforms#647

Open
rminnikanti wants to merge 2 commits intosonic-net:masterfrom
rminnikanti:fix_chassis_db_errors
Open

Fix CHASSIS_STATE_DB errors on non-chassis platforms#647
rminnikanti wants to merge 2 commits intosonic-net:masterfrom
rminnikanti:fix_chassis_db_errors

Conversation

@rminnikanti
Copy link
Copy Markdown

@rminnikanti rminnikanti commented Apr 13, 2026

Fixes #654

What I did

Fixed syslog errors across gnmi container restarts

ERR gnmi#telemetry: :- getDbInfo: Failed to find CHASSIS_STATE_DB database in : key
ERR gnmi#dialout_client_cli: :- getDbInfo: Failed to find CHASSIS_STATE_DB database in : key

How I did it

Added check to ensure DB present on the running DB config before attempting to access it. On non-chassis platforms (e.g. single-ASIC), the database container strips the chassis DB entries from database_config.json at startup. Attempting to connect without this guard causes libswsscommon to throw "Failed to find CHASSIS_STATE_DB database in : key" on every process start.

How to verify it

Run sonic-mgmt tests that does config reload and does log analyzer. Verified tests don't face teardown errors.

./run_tests.sh -n ptf2-m -d str-marvell-tl7-01 -f ../ansible/testbed.yaml -i ../ansible/lab,../ansible/veos -t t0,any -c hash/test_generic_hash_packet_type.py::test_pkt_type_hash_config_persistence_reload -u

Below error logs that appear across gnmi restarts:
ERR gnmi#telemetry: :- getDbInfo: Failed to find CHASSIS_STATE_DB database in : key
ERR gnmi#dialout_client_cli: :- getDbInfo: Failed to find CHASSIS_STATE_DB database in : key

These logs cause teardown errors in sonic-mgmt tests

Signed-off-by: Ravi Minnikanti <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHASSIS_STATE_DB error logs on non-chassis platforms resulting in sonic-mgmt teardown errors

2 participants