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

sfputil CLI broken on master/202305 for multi-asic platforms #3167

Open
longhuan-cisco opened this issue Feb 17, 2024 · 0 comments
Open

sfputil CLI broken on master/202305 for multi-asic platforms #3167

longhuan-cisco opened this issue Feb 17, 2024 · 0 comments

Comments

@longhuan-cisco
Copy link
Contributor

Description

On 202305 multi-asic platforms, sfpuil CLI (basically any sub-command under sfputil) always bails out for below error:

# sfputil show presence
Error reading port info (:- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig)

Looks like, this is related to PR [portconfig]: Remove try exception during config_db initialization. by SuvarnaMeenakshi · Pull Request #10960 · sonic-net/sonic-buildimage Basically this PR removed the initialization of global DB config from portconfig.py lib and expects application code to do it, however here the application (sfputil/sfputilhelper) didn’t get updated accordingly to do the initialization, thus error happened Error reading port info (:- validateNamespace: Initialize global DB config using API
And I tried reverting this PR’s change on 202305 setup, then issue was gone.

And this issue is specific to platforms with multi-asic/namespace. For single-asic platforms, there’s no global DB config (/run/redis/sonic-db/database_global.json), no need to initialize.
PR #10960 (merged on late 2022) is included in master and 202305 branches, but not included in 202205 branch, that’s why issue not seen on 202205 image.

202205: https://github.com/sonic-net/sonic-buildimage/blob/202205/src/sonic-config-engine/portconfig.py#L77
202305: https://github.com/sonic-net/sonic-buildimage/blob/202305/src/sonic-config-engine/portconfig.py#L75

Steps to reproduce the issue

Do any sfputil CLI (e.g. sfputil show presence)

Describe the results you received

# sfputil show presence
Error reading port info (:- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig)

Describe the results you expected

Actual contents of sfputil commands. e.g. sfputil show presence should show the presence status for each ports

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)
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

No branches or pull requests

1 participant