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

[ZTP]config-setup adds error log due to failed yang validation on the first boot after a fresh image installation when ZTP is enabled #21464

Open
gpunathilell opened this issue Jan 17, 2025 · 0 comments

Comments

@gpunathilell
Copy link
Contributor

This issue is caused when we perform a new image installation (through ONIE), once the image is installed if ZTP is enabled and the /etc/sonic/config_db.json is absent in the image, the config-setup generates ztp_config.json

generate_config ztp ${TMP_ZTP_CONFIG_DB_JSON}

/usr/lib/ztp/ztp-profile.sh create ${DEST_FILE}

This configuration contains the ZTP key
https://github.com/sonic-net/sonic-ztp/blob/b4cdd8c58bc419f37b91e783b357bff4c5174536/src/usr/lib/ztp/templates/ztp-config.j2#L41
Once this config is added and we perform config reload with this:
reload_configdb ${TMP_ZTP_CONFIG_DB_JSON}

The config reload calls db_migrator which has the config_validator
https://github.com/sonic-net/sonic-utilities/blob/3aec51927b06fd8cce2d71adec0ec5ad7f2abf53/scripts/db_migrator.py#L1317
https://github.com/sonic-net/sonic-utilities/blob/a5b7a904663a14b781a864f7354065fbec767fe1/scripts/config_validator.py#L39
Which causes the log error:
2025 Jan 14 19:20:26.658286 sonic ERR config_validator.py: Tables without yang models: {'ZTP': {'mode': {'inband': 'true', 'ipv4': 'true', 'ipv6': 'true', 'out-of-band': 'true', 'product-name': 'XXXX', 'profile': 'active', 'serial-no': 'XXXXXXXXXXX'}}}

Steps to Reproduce

  • Build image with ENABLE_ZTP=y
  • onie_install the image
  • Confirm ztp is enabled using ztp status -c
  • Log error is present in the syslog
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