After first bootup, the FEATURE table is not present in CONFIG_DB#5911
After first bootup, the FEATURE table is not present in CONFIG_DB#5911abdosi merged 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Akhilesh Samineni <[email protected]>
|
@AkhileshSamineni what is the sequence for this issue to come ? Below file always make sure Feature Table is there in config db |
@abdosi At the time of reboot process, the init_cfg.json file contents are written to config_db only when config_db.json file is present. So at time of onie-install, config_db.json file is not present and there by "FEATURE" table is not getting written to config_db. And here https://github.com/Azure/sonic-buildimage/blob/master/files/image_config/config-setup/config-setup#L252, load_config() is not writing the init_cfg.json file contents to config_db. Fix for this to replace the load_config() with reload_configdb(), where 'config reload' script takes care of writing init_cfg.json file contents to config_db. |
|
@abdosi - are you ready to approve pls? |
| /usr/local/bin/db_migrator.py -o migrate | ||
| fi | ||
|
|
||
| sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" |
There was a problem hiding this comment.
I think we have a dependency on this CONFIG_DB_INITIALIZED elsewhere. Do we not need this?
There was a problem hiding this comment.
Issue : After first bootup, the FEATURE table is not present in CONFIG_DB
root@sonic:/home/admin# sonic-db-cli CONFIG_DB keys *FEAT*
root@sonic:/home/admin#
(With Fix from PR - sonic-net/sonic-utilities#1232)
root@sonic:/home/admin# config feature state nat enabled
Feature 'nat' doesn't exist
root@sonic:/home/admin#
And then, If I do 'cold reboot' or 'config reload', the FEATURE table gets added to CONFIG_DB.
After reboot/config-reload,
root@sonic:/home/admin# sonic-db-cli CONFIG_DB keys *FEAT*
FEATURE|nat
FEATURE|bgp
FEATURE|syncd
FEATURE|sflow
FEATURE|telemetry
FEATURE|snmp
FEATURE|pmon
FEATURE|swss
FEATURE|mgmt-framework
FEATURE|database
FEATURE|radv
FEATURE|lldp
FEATURE|teamd
FEATURE|dhcp_relay
root@sonic:/home/admin#
Rootcause:
While first boot up, the init_cfg.json file (contains FEATURE table) contents are not getting written to CONFIG_DB.
And later 'cold reboot' or 'config reload', init_cfg.json file contents are writing to CONFIG_DB.
Fix : Added changes to do "config reload" instead of "load config" in config-setup script, as it handles the config_db contents at first bootup.
'config reload' script takes care of writing 'init_cfg.json' file to CONFIG_DB.
Signed-off-by: Akhilesh Samineni [email protected]