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

'configdb-json' plug-in script seems to have some errors while saving config_db.json file #54

Open
simonleedotcom opened this issue Nov 1, 2023 · 0 comments

Comments

@simonleedotcom
Copy link

simonleedotcom commented Nov 1, 2023

When saving the downloaded config_db.json file from the provisioning server, it seems like the file is not moved to the final destination properly.

[Part of 'configdb-json' plug-in script]

227             # Move staged config file to requested destination file
228             if final_dest_file is not None: 
229                 os.rename(dest_file, final_dest_file)    ## This part seems problematic -> not executing
230             else:
231                 os.remove(dest_file)

[FYI]
(dest_file = /tmp/config_dl.json)
(final_dest_file = /etc/sonic/config_db.json)

[Related ZTP Logs]

Nov  1 01:02:58.068369 SWITCH INFO sonic-ztp[4480]: configdb-json: Stopping ZTP discovery on interfaces.
Nov  1 01:03:05.713241 SWITCH INFO sonic-ztp[4480]: configdb-json: Reloading config_db.json to Config DB.
Nov  1 01:05:32.235882 SWITCH DEBUG sonic-ztp[1929]: Plugin /usr/lib/ztp/plugins/configdb-json /var/lib/ztp/sections/01-
initial-config/input.json exit code = 1.
Nov  1 01:05:32.235923 SWITCH INFO sonic-ztp[1929]: Processed Configuration section 01-initial-config with result FAILED, exit code (1) at 2023-11-01 01:02:57 UTC.
Nov  1 01:05:32.243384 SWITCH DEBUG sonic-ztp[1929]: Removing section 01-initial-config from list. Status FAILED.
Nov  1 01:05:32.243655 SWITCH INFO sonic-ztp[1929]: Checking configuration section 01-initial-config result: FAILED, ignore-result: False.
Nov  1 01:05:32.257807 SWITCH INFO sonic-ztp[1929]: ZTP failed at 2023-11-01 01:05:32 UTC as configuration section 01-initial-config FAILED.
Nov  1 01:05:32.268859 SWITCH WARNING sonic-ztp[1929]: ZTP completed but startup configuration '/etc/sonic/config_db.json' not found. Waiting for 30 seconds before restarting ZTP.
@simonleedotcom simonleedotcom changed the title 'configdb-json 'configdb-json' plug-in script seems to have some errors while saving config_db.json file Nov 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant