Skip to content

ZTP Error (1) encountered while processing the command curl  #15

@Ezrickd

Description

@Ezrickd

Sonic Image Based on 201911

ZTP process fail to execute ztp.json file.

return with Err "sonic ERR sonic-ztp[3572]: !Error (1) encountered while processing the command : /usr/bin/curl -f -v -s -o /var/run/ztp/ztp_data_opt67.json -A "SONiC-0"

issue related to extra characters parsing of EEPROM info at.
ZTP process collect the following decode-syseeprom -p / decode-syseeprom -s / decode-syseeprom -m for HTTP session unique info.
found that the add unique Info to the curl command break the file fetch.

attached syslog.

Jun 2 16:13:56.035865 sonic INFO sonic-ztp[3572]: ZTP service started.
Jun 2 16:13:56.036381 sonic INFO sonic-ztp[3572]: Checking running configuration to load ZTP configuration profile.
Jun 2 16:13:56.946697 sonic INFO sonic-ztp[3570]: Waiting for system online status before continuing ZTP. (This may take 30--120 seconds).
Jun 2 16:15:12.164409 sonic INFO sonic-ztp[3570]: System is ready to respond.
Jun 2 16:15:12.375346 sonic INFO sonic-ztp[3572]: Link up detected for interface eth0
Jun 2 16:15:12.376191 sonic INFO sonic-ztp[3572]: Restarting network discovery after link scan.
Jun 2 16:15:21.692716 sonic INFO sonic-ztp[3572]: Restarted network discovery after link scan.
Jun 2 16:15:31.769706 sonic INFO sonic-ztp[3572]: Downloading provisioning data from http://11.11.11.1/ZTP/4700-1-ztp.json to /var/run/ztp/ztp_data_opt67.json
Jun 2 16:15:32.011267 sonic ERR sonic-ztp[3572]: !Error (1) encountered while processing the command : /usr/bin/curl -f -v -s -o /var/run/ztp/ztp_data_opt67.json -A "SONiC-0
Jun 2 16:15:32.012177 sonic ERR sonic-ztp[3572]: Exception ['NoneType' object is not iterable] encountered while running the discovery logic.
Jun 2 16:15:32.017719 sonic WARNING sonic-ztp[3572]: Invalid provisioning data received. Waiting for 300 seconds before restarting ZTP.

we can see in decode-syseeprom that there are trailing Null in eeprom. when remove the Null ZTP works.

admin@l-csi-4700-02:~$ sudo decode-syseeprom -p | hexdump -c
0000000 M S N 4 7 0 0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000010 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0000040 \n
0000041

when EEPROM has the following content it works.
root@AE-2700-5-Sonic:# decode-syseeprom -p | hexdump -c
0000000 M S N 2 7 0 0 \n
0000008
root@AE-2700-5-Sonic:#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions