Skip to content
New issue

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

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

Already on GitHub? # to your account

After onie install with latest sonic-utilities configuration is not loaded into CONFIG_DB resulting in failure to initialize switch #20730

Closed
dgsudharsan opened this issue Nov 8, 2024 · 7 comments · Fixed by #21110
Assignees
Labels
Issue for 202405 MSFT Triaged this issue has been triaged

Comments

@dgsudharsan
Copy link
Collaborator

Description

Issue due to yang validation introduced in the PR sonic-net/sonic-utilities#3576

The config-setup generates a configuration which is not yang aligned. For example loopback and interface tables are defined like below

    "LOOPBACK_INTERFACE": {
        "Loopback0|10.1.0.1/32": {}
    },
   "INTERFACE": {
        "Ethernet0|10.0.0.0/31": {},

While yang expects it to

    "LOOPBACK_INTERFACE": {
        "Loopback0": {},
        "Loopback0|10.1.0.1/32": {}
    },
    "INTERFACE": {
        "Ethernet0": {},
        "Ethernet0|10.0.0.0/31": {},
2024 Nov  8 03:57:59.954048 r-tigris-04 INFO config-setup[3665]: No configuration detected, generating factory default configuration...
2024 Nov  8 03:58:00.299118 r-tigris-04 INFO config-setup[3665]: Reloading existing config db...
2024 Nov  8 03:58:00.617087 r-tigris-04 NOTICE switch_hash: 'reload' executing with command: config reload /etc/sonic/config_db.json -y -n
2024 Nov  8 03:58:00.617004 r-tigris-04 INFO config-setup[4045]: Acquired lock on /etc/sonic/reload.lock
2024 Nov  8 03:58:00.819290 r-tigris-04 INFO config-setup[4045]: libyang[0]: Leafref "../../LOOPBACK_INTERFACE_LIST/name" of value "Loopback0" points to a non-existing leaf. (path: /sonic-loopback-interface:sonic-loopback-interface/LOOPBACK_INTERFACE/LOOPBACK_INTERFACE_IPPREFIX_LIST[name='Loopback0'][ip-prefix='10.1.0.1/32']/name)
2024 Nov  8 03:58:00.819731 r-tigris-04 INFO config-setup[4045]: sonic_yang(3):Data Loading Failed:Leafref "../../LOOPBACK_INTERFACE_LIST/name" of value "Loopback0" points to a non-existing leaf.
2024 Nov  8 03:58:00.819755 r-tigris-04 INFO config-setup[4045]: /etc/sonic/config_db.json fails YANG validation! Error: Data Loading Failed
2024 Nov  8 03:58:00.819775 r-tigris-04 INFO config-setup[4045]: Leafref "../../LOOPBACK_INTERFACE_LIST/name" of value "Loopback0" points to a non-existing leaf.
2024 Nov  8 03:58:00.819800 r-tigris-04 INFO config-setup[4045]: Released lock on /etc/sonic/reload.lock
2024 Nov  8 03:58:00.819868 r-tigris-04 INFO config-setup[4045]: Aborted!
2024 Nov  8 03:58:00.880277 r-tigris-04 INFO config-setup[4372]: True
2024 Nov  8 03:58:00.881941 r-tigris-04 INFO systemd[1]: Finished config-setup.service - Config initialization and migration service.

Steps to reproduce the issue:

Describe the results you received:

Describe the results you expected:

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

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

@dgsudharsan
Copy link
Collaborator Author

@qiluo-msft @wen587 Can you please prioritize this as this is a regression issue?

@qiluo-msft
Copy link
Collaborator

@wen587 , seems "factory default configuration" fails yang validation.

@qiluo-msft
Copy link
Collaborator

@dgsudharsan Could you share the /etc/sonic/config_db.json when issue happens?

@prgeor prgeor added Triaged this issue has been triaged MSFT labels Nov 20, 2024
@wen587
Copy link
Contributor

wen587 commented Dec 2, 2024

hi @dgsudharsan , config-setup runs when image first boot up.
What is the config source of the /etc/sonic/config_db.json? It is this file fails yang validation. If image boot up without deleting previous config_db.json, it will use the old config_db.json in old image instead of load_minigraph.
Could you run sudo config load_minigraph -y to see if we can mitigate this issue?

@wen587
Copy link
Contributor

wen587 commented Dec 10, 2024

I will own the fix.

@dgsudharsan
Copy link
Collaborator Author

@wen587 @qiluo-msft I don't think the fix addresses the use case I have. In my case its the interface table and config-setup needs to be fixed. The fix you marked is related to smartswitch and unrelated to my scenario.

@wen587
Copy link
Contributor

wen587 commented Jan 9, 2025

Hi @dgsudharsan , another fix is on the way: #21195

VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this issue Jan 21, 2025
Fixes: sonic-net#20730

Why I did it
The generated t1 config fails YANG validation, which leads to config setup failure since we enforce YANG validation in config reload.

How I did it
Update config to align with YANG

How to verify it
Run YANG validate on generated config.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Issue for 202405 MSFT Triaged this issue has been triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants