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

[multi-asic] ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized #13137

Open
abdosi opened this issue Dec 21, 2022 · 3 comments
Assignees
Labels
Chassis 🤖 Modular chassis support Triaged this issue has been triaged

Comments

@abdosi
Copy link
Contributor

abdosi commented Dec 21, 2022

Issue:
Run any show command on mutli-asic-platform and we see this message getting printed for each asic.

ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized

On debugging looks like swsscommon.SonicDBConfig.isGlobalInit is always false and thus we see the message.
However same logic works fine for single asic where swsscommon.SonicDBConfig.isInit() return True.

def load_db_config():
    '''
    Load the correct database config file:
     - database_global.json for multi asic
     - database_config.json for single asic
    '''
    if is_multi_asic():
        if not swsscommon.SonicDBConfig.isGlobalInit():
            swsscommon.SonicDBConfig.load_sonic_global_db_config()
    else:
        if not swsscommon.SonicDBConfig.isInit():
            swsscommon.SonicDBConfig.load_sonic_db_config()

Because of this ERR message we see failure when sonic-mgmt test case is run with log-analyzer enable.

@abdosi
Copy link
Contributor Author

abdosi commented Dec 21, 2022

@SuvarnaMeenakshi please follow up on this.

@arlakshm and @judyjoseph for viz.

@abdosi abdosi added the Chassis 🤖 Modular chassis support label Dec 21, 2022
@abdosi
Copy link
Contributor Author

abdosi commented Dec 21, 2022

cc @anamehra for viz.

abdosi added a commit to abdosi/sonic-mgmt that referenced this issue Dec 22, 2022
sonic-net/sonic-buildimage#13137

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@gechiang gechiang added the Triaged this issue has been triaged label Jan 4, 2023
judyjoseph pushed a commit to sonic-net/sonic-mgmt that referenced this issue Feb 7, 2023
* Temproray workaround for the issue
sonic-net/sonic-buildimage#13137
---------
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this issue Feb 8, 2023
* Temproray workaround for the issue
sonic-net/sonic-buildimage#13137
---------
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
kellyyeh pushed a commit to kellyyeh/sonic-mgmt that referenced this issue Mar 31, 2023
)

* Temproray workaround for the issue
sonic-net/sonic-buildimage#13137
---------
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@deepak-singhal0408
Copy link
Contributor

The Error Message comes when SonicDBConfig::initializeGlobalConfig gets called and GlobalConfig is already initialized.

The above gets invoked from load_db_config.

For "show interface status" on a multi-asic Card, load_db_config gets called multiple times(4 times on a 2-asic linecard)
First at the entrypoint of show command. sonic-utilities/show/main.py
Second during creation of IntfStatus Object: sonic-utilities/scripts/intfutil
Next 2 are called from get_port_config() :(once for each asic), which again tries to invoke GlobalConfigInit.

In this case, for first 2 iteration, we do check if its already initilaized, but the get_port_config() doesnt check this.

There are other places as well in the code, where we call the aboveAPI without checking if already initialized.

This message is harmless. If the Config is already initilaized, it just returns and if not, it initializes it. Hence, Instead of adding validation at multiple places, will remove the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis 🤖 Modular chassis support Triaged this issue has been triaged
Projects
Status: No status
Development

No branches or pull requests

5 participants