Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed syslog error "ERR python3:- validateNamespace: Initialize global.." for sfpshow #3753

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

anamehra
Copy link
Contributor

@anamehra anamehra commented Feb 7, 2025

Signed-off-by: Anand Mehra [email protected]

What I did

Fixed the "ERR python3: [ :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig]"
error when running 'show interfaces transceiver <>' commands.
e.g. show interfaces transceiver info Ethernet0

The error is observed in syslogs but not on the command line.

This log was seen while running snappi_tests/multidut/pfc/test_m2o_fluctuating_lossless.py::test_m2o_fluctuating_lossless[multidut_port_info1] ERROR [100%]

E Match Messages:
E 2025 Jan 7 06:27:14.025905 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig
E
E 2025 Jan 7 06:27:19.861658 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig
E
E 2025 Jan 7 06:27:44.184059 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig

How I did it

Call load_db_config before multi-asic method calls.
Added test coverage.

How to verify it

Run commands like 'show interfaces transceiver info Ethernet0' on multi-asic system and check syslogs.
It should not generate the ERR logs as mentioned above.

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)

anamehra and others added 2 commits February 7, 2025 10:08
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@anamehra
Copy link
Contributor Author

Hi @abdosi , @sdszhang , for your viz. Thanks

@mihirpat1 mihirpat1 requested a review from Copilot March 12, 2025 01:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an error regarding the initialization of the global DB configuration when running transceiver commands on multi-ASIC systems by ensuring load_db_config() is called. The changes include enhanced test coverage for scenarios when the namespace is not provided and modifications to the CLI commands in sfpshow to call load_db_config().

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/sfp_test.py Added new tests to verify behavior of transceiver commands without namespace
scripts/sfpshow Updated CLI commands to call load_db_config() before namespace resolution
Comments suppressed due to low confidence (1)

scripts/sfpshow:651

  • [nitpick] Consider refactoring the repeated calls to load_db_config() across multiple CLI command handlers into a common helper function to reduce duplication and ensure consistency.
load_db_config()

@sdszhang
Copy link
Contributor

@anamehra can you update the title and description to indicate this error is an error in syslog, not in command output? Thanks.

@anamehra anamehra changed the title Fixed "ERR python3:- validateNamespace: Initialize global.." for sfpshow Fixed syslog error "ERR python3:- validateNamespace: Initialize global.." for sfpshow Mar 12, 2025
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1
Copy link
Contributor

@anamehra Can you please explain the impact of this error message?

@prgeor Can you please help in reviewing this?

@anamehra
Copy link
Contributor Author

@anamehra Can you please explain the impact of this error message?

Hi @mihirpat1 , updated the description. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants