PackeTsar / freeztp

An Open-Source Zero-Touch Provisioning System for Cisco IOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TFTP script Error

zholbrook opened this issue · comments

I am getting this error on the console of the switch and the switch fails to provision.
%SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x.x/network-confg

What are your thoughts on this?

The more I think about it the moreI still thank that is the issue, that the switch is not requesting the second part of the config. However I dont understand why. I just did a 10 switch deployment 2 were provisioned correctly and 8 only did the code upgrade the the init-template. I will post the output.

[user@ztp ~]# ztp show log
2020-06-18 15:52:35: Log file has been cleared
2020-06-18 15:57:52: tracking_class.report: New transfer of (freeztp_ios_upgrade) from (x.x.x.184) detected
2020-06-18 15:57:52: interceptor: Called. Checking the cache
2020-06-18 15:57:52: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x.184) not in cache
2020-06-18 15:57:52: interceptor: Cache returned None. Running cfact.lookup procedure
2020-06-18 15:57:52: cfact.lookup: Called. Checking filename (freeztp_ios_upgrade) and IP (x.x.x.184)
2020-06-18 15:57:52: cfact.lookup: Requested filename matches the imagediscoveryfile
2020-06-18 15:57:52: cfact.lookup: #############IOS UPGRADE ABOUT TO BEGIN!!!#############
2020-06-18 15:57:52: interceptor: cfact.lookup returned (True)
2020-06-18 15:57:52: interceptor: Returning ztp_dyn_file instantiated object
2020-06-18 15:57:52: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7fb375981f80>)
2020-06-18 15:57:52: cfact.request: Called with filename (freeztp_ios_upgrade) and IP (x.x.x.184)
2020-06-18 15:57:52: cfact.request: Filename (freeztp_ios_upgrade) matches the configured imagediscoveryfile
2020-06-18 15:57:52: cfact._check_supression: Called. Checking for image download supression for IP (x.x.x.184)
2020-06-18 15:57:52: cfact._check_supression: Previous session not detected within 3600 seconds.
2020-06-18 15:57:52: cfact.request: Returning the value of the imagefile setting (cat9k_lite_iosxe.x.x.x..SPA.bin)
2020-06-18 15:57:52: ztp_dyn_file: File size is 33 bytes
2020-06-18 15:57:52: file_cache.store: Storing {1592513872.372013: {'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7fb375981f80>, 'filename': 'freeztp_ios_upgrad
e'}}
2020-06-18 15:57:52: ztp_dyn_file.close: Called. File closing.
2020-06-18 15:57:52: interceptor: Called. Checking the cache
2020-06-18 15:57:52: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 15:57:52: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 15:57:58: tracking_class.report: New transfer of (cat9k_lite_iosxe.x.x.x..SPA.bin) from (x.x.x.184) detected
2020-06-18 15:58:03: file_cache._maintain_cache: Timing out and deleting 1592513872.37:{'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7fb375981f80>, 'filename':
'freeztp_ios_upgrade'}
2020-06-18 16:03:19: tracking_class.report: New transfer of (network-confg) from (x.x.x.184) detected
2020-06-18 16:03:19: interceptor: Called. Checking the cache
2020-06-18 16:03:19: file_cache.get: File (network-confg) requested by (x.x.x.184) not in cache
2020-06-18 16:03:19: interceptor: Cache returned None. Running cfact.lookup procedure
2020-06-18 16:03:19: cfact.lookup: Called. Checking filename (network-confg) and IP (x.x.x.184)
2020-06-18 16:03:19: cfact.lookup: Requested filename matches the initialfilename. Returning True
2020-06-18 16:03:19: interceptor: cfact.lookup returned (True)
2020-06-18 16:03:19: interceptor: Returning ztp_dyn_file instantiated object
2020-06-18 16:03:19: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7fb3758eb998>)
2020-06-18 16:03:19: cfact.request: Called with filename (network-confg) and IP (x.x.x.184)
2020-06-18 16:03:19: cfact.request: Filename (network-confg) matches the configured initialfilename
2020-06-18 16:03:19: cfact.request: Generated a TempID with cfact._generate_name: (ZTP-25141FD313)
2020-06-18 16:03:19: cfact.request: Generated a SNMP Request with TempID (ZTP-25141FD313) and IP (x.x.x.184)
2020-06-18 16:03:19: cfact.request: Returning the below initial config to TFTPy:
#########################
hostname ZTP-25141FD313
!
snmp-server community secretcommunity RO
!
end
^hostname ZTP-25141FD313
!
snmp-server community secretcommunity RO
!
end
#########################
2020-06-18 16:03:19: ztp_dyn_file: File size is 146 bytes
2020-06-18 16:03:19: file_cache.store: Storing {1592514199.467637: {'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7fb3758eb998>, 'filename': 'network-confg'}}
2020-06-18 16:03:19: snmp_query._query_worker: Attempting SNMP Query
2020-06-18 16:03:19: interceptor: Called. Checking the cache
2020-06-18 16:03:19: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:19: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:19: ztp_dyn_file.close: Called. File closing.
2020-06-18 16:03:20: interceptor: Called. Checking the cache
2020-06-18 16:03:20: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:20: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:20: interceptor: Called. Checking the cache
2020-06-18 16:03:20: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:20: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:21: interceptor: Called. Checking the cache
2020-06-18 16:03:21: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:21: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:21: interceptor: Called. Checking the cache
2020-06-18 16:03:21: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:21: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:22: interceptor: Called. Checking the cache
2020-06-18 16:03:22: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:22: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:22: interceptor: Called. Checking the cache
2020-06-18 16:03:22: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:22: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:23: interceptor: Called. Checking the cache
2020-06-18 16:03:23: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:23: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:23: interceptor: Called. Checking the cache
2020-06-18 16:03:23: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:23: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:23: interceptor: Called. Checking the cache
2020-06-18 16:03:23: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:23: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:23: interceptor: Called. Checking the cache
2020-06-18 16:03:23: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-18 16:03:23: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:03:25: snmp_query._query_worker: SNMP Query Timed Out
2020-06-18 16:03:25: snmp_query._query_worker: Attempting SNMP Query
2020-06-18 16:03:26: snmp_query._query_worker: SNMP Query Successful (OID: WS_C3850_SERIAL_NUMBER). Host (x.x.x.184) responded with (JSCRUBBED)
2020-06-18 16:03:30: file_cache._maintain_cache: Timing out and deleting 1592514199.47:{'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7fb3758eb998>, 'filename':
'network-confg'}

Is your initial-config malformed? Looks like you have a leading caret in front of a second instance of the hostname.

#########################
hostname ZTP-25141FD313
!
snmp-server community secretcommunity RO
!
end
^hostname ZTP-25141FD313
!
snmp-server community secretcommunity RO
!
end
#########################

dang, let me fix that and try again. Still strange that 2 switches worked.

OK initial config fixed but same result

2020-06-18 16:20:19: Provisioning history has been cleared
2020-06-18 16:20:35: Downloads have been cleared
2020-06-18 16:41:08: #########################################################
2020-06-18 16:41:08: Restarting the ZTP Service
2020-06-18 16:41:08: #########################################################
2020-06-18 16:41:09: integration_main._load: Beginning load of integration objects. Make sure your internet connection is working properly.
2020-06-18 16:41:09: interpreter: Command to run received. Calling start_tftp
2020-06-18 16:41:09: start_tftp: Starting Up TFTPy
2020-06-18 16:46:40: tracking_class.report: New transfer of (freeztp_ios_upgrade) from (x.x.x..184) detected
2020-06-18 16:46:40: interceptor: Called. Checking the cache
2020-06-18 16:46:40: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x..184) not in cache
2020-06-18 16:46:40: interceptor: Cache returned None. Running cfact.lookup procedure
2020-06-18 16:46:40: cfact.lookup: Called. Checking filename (freeztp_ios_upgrade) and IP (x.x.x..184)
2020-06-18 16:46:40: cfact.lookup: Requested filename matches the imagediscoveryfile
2020-06-18 16:46:40: cfact.lookup: #############IOS UPGRADE ABOUT TO BEGIN!!!#############
2020-06-18 16:46:40: interceptor: cfact.lookup returned (True)
2020-06-18 16:46:40: interceptor: Returning ztp_dyn_file instantiated object
2020-06-18 16:46:40: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f0bcd684440>)
2020-06-18 16:46:40: cfact.request: Called with filename (freeztp_ios_upgrade) and IP (x.x.x..184)
2020-06-18 16:46:40: cfact.request: Filename (freeztp_ios_upgrade) matches the configured imagediscoveryfile
2020-06-18 16:46:40: cfact._check_supression: Called. Checking for image download supression for IP (x.x.x..184)
2020-06-18 16:46:40: cfact._check_supression: Previous session not detected within 3600 seconds.
2020-06-18 16:46:40: cfact.request: Returning the value of the imagefile setting (cat9k_lite_iosxe.x.x.x..SPA.bin)
2020-06-18 16:46:40: ztp_dyn_file: File size is 33 bytes
2020-06-18 16:46:40: file_cache.store: Storing {1592516800.566333: {'ipaddr': 'x.x.x..184', 'file': <main.ztp_dyn_file instance at 0x7f0bcd684440>, 'filename': 'freeztp_ios_upgrad
e'}}
2020-06-18 16:46:40: ztp_dyn_file.close: Called. File closing.
2020-06-18 16:46:40: interceptor: Called. Checking the cache
2020-06-18 16:46:40: file_cache.get: File (freeztp_ios_upgrade) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:46:40: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:46:46: tracking_class.report: New transfer of (cat9k_lite_iosxe.x.x.x..SPA.bin) from (x.x.x..184) detected
2020-06-18 16:46:50: file_cache._maintain_cache: Timing out and deleting 1592516800.57:{'ipaddr': 'x.x.x..184', 'file': <main.ztp_dyn_file instance at 0x7f0bcd684440>, 'filename':
'freeztp_ios_upgrade'}
2020-06-18 16:49:06: #########################################################
2020-06-18 16:49:06: Restarting the ZTP Service
2020-06-18 16:49:06: #########################################################
2020-06-18 16:49:07: integration_main._load: Beginning load of integration objects. Make sure your internet connection is working properly.
2020-06-18 16:49:07: interpreter: Command to run received. Calling start_tftp
2020-06-18 16:49:07: start_tftp: Starting Up TFTPy
2020-06-18 16:49:29: tracking_class.report: New transfer of (network-confg) from (x.x.x..184) detected
2020-06-18 16:49:29: interceptor: Called. Checking the cache
2020-06-18 16:49:29: file_cache.get: File (network-confg) requested by (x.x.x..184) not in cache
2020-06-18 16:49:29: interceptor: Cache returned None. Running cfact.lookup procedure
2020-06-18 16:49:29: cfact.lookup: Called. Checking filename (network-confg) and IP (x.x.x..184)
2020-06-18 16:49:29: cfact.lookup: Requested filename matches the initialfilename. Returning True
2020-06-18 16:49:29: interceptor: cfact.lookup returned (True)
2020-06-18 16:49:29: interceptor: Returning ztp_dyn_file instantiated object
2020-06-18 16:49:29: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f455841dd40>)
2020-06-18 16:49:29: cfact.request: Called with filename (network-confg) and IP (x.x.x..184)
2020-06-18 16:49:29: cfact.request: Filename (network-confg) matches the configured initialfilename
2020-06-18 16:49:29: cfact.request: Generated a TempID with cfact._generate_name: (ZTP-2514240D2F)
2020-06-18 16:49:29: cfact.request: Generated a SNMP Request with TempID (ZTP-2514240D2F) and IP (x.x.x..184)
2020-06-18 16:49:29: cfact.request: Returning the below initial config to TFTPy:
#########################
hostname ZTP-2514240D2F
!
snmp-server community secretcommunity RO
!
end
#########################
2020-06-18 16:49:29: ztp_dyn_file: File size is 72 bytes
2020-06-18 16:49:29: file_cache.store: Storing {1592516969.638249: {'ipaddr': 'x.x.x..184', 'file': <main.ztp_dyn_file instance at 0x7f455841dd40>, 'filename': 'network-confg'}}
2020-06-18 16:49:29: snmp_query._query_worker: Attempting SNMP Query
2020-06-18 16:49:29: interceptor: Called. Checking the cache
2020-06-18 16:49:29: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:29: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:29: ztp_dyn_file.close: Called. File closing.
2020-06-18 16:49:30: interceptor: Called. Checking the cache
2020-06-18 16:49:30: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:30: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:30: interceptor: Called. Checking the cache
2020-06-18 16:49:30: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:30: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:31: interceptor: Called. Checking the cache
2020-06-18 16:49:31: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:31: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:31: interceptor: Called. Checking the cache
2020-06-18 16:49:31: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:31: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:32: interceptor: Called. Checking the cache
2020-06-18 16:49:32: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:32: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:32: interceptor: Called. Checking the cache
2020-06-18 16:49:32: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:32: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:33: interceptor: Called. Checking the cache
2020-06-18 16:49:33: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:33: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:33: interceptor: Called. Checking the cache
2020-06-18 16:49:33: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:33: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:33: interceptor: Called. Checking the cache
2020-06-18 16:49:33: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:33: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:33: interceptor: Called. Checking the cache
2020-06-18 16:49:33: file_cache.get: File (network-confg) requested by (x.x.x..184) found in cache. Checking timeout.
2020-06-18 16:49:33: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-18 16:49:34: snmp_query._query_worker: SNMP Query Successful (OID: WS_C3850_SERIAL_NUMBER). Host (x.x.x..184) responded with (JSCRUBBED)
2020-06-18 16:49:40: file_cache._maintain_cache: Timing out and deleting 1592516969.64:{'ipaddr': 'x.x.x..184', 'file': <main.ztp_dyn_file instance at 0x7f455841dd40>, 'filename':
'network-confg'}

merge tests based on SN seem fine in ztp

Switch console output

Loading freeztp_ios_upgrade from x.x.x.4 (via Vlan1): !
[OK - 33 bytes]

Press RETURN to get started!

*Jun 19 14:21:45.573: %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
*Jun 19 14:21:45.599: %PKI-4-NOCONFIGAUTOSAVE: Configuration was modified. Issue "write memory" to save new IOS PKI configuration
*Jun 19 14:21:45.776: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named TP-self-signed-2523726127.server has been generated or imported by crypto-engine
*Jun 19 14:26:09.938: %IOSXE_INFRA-6-PROCPATH_CLIENT_HOG: IOS shim client 'ngwc fed bipc' has taken 1384 msec (runtime: 932 msec) to process a 'unknown' message
*Jun 19 14:26:45.497: MCP_INSTALLER_NOTICE: NGMOD-Image install passed
*Jun 19 14:26:45.584: AUTOINSTALL: Obtain tftp server address (opt 150) x.x.x.4
*Jun 19 14:26:45.584: PNPA: Setting autoinstall complete to true for x.x.x.4
*Jun 19 14:26:45.205: %INSTALL-5-INSTALL_COMPLETED_INFO: Switch 1 R0/0: install_engine: Completed install one-shot PACKAGE flash:cat9k_lite_iosxe.x.x.x..SPA.bin
*Jun 19 14:26:46.315: %SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x.4/network-confg
Loading network-confg from x.x.x.4 (via Vlan1): !
[OK - 72 bytes]

*Jun 19 14:26:53.248: %SYS-5-CONFIG_I: Configured from tftp://1.1.1.1/network-confg by console
*Jun 19 14:26:54.258: AUTOINSTALL: Tftp script execution successful for Vl1.
*Jun 19 14:27:58.636: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Discovery Aborted)
ZTP-25147F6CE3>

Try disabling the IOS upgrade (ztp set dhcpd SCOPENAME imagediscoveryfile-option disable), clearing the log, and running it. Then post a log of what happens.

Make sure to do a ztp request dhcpd-commit after you make the scope change

ZTP log:

2020-06-19 10:01:21: Log file has been cleared
2020-06-19 10:06:34: tracking_class.report: New transfer of (network-confg) from (x.x.x.184) detected
2020-06-19 10:06:34: interceptor: Called. Checking the cache
2020-06-19 10:06:34: file_cache.get: File (network-confg) requested by (x.x.x.184) not in cache
2020-06-19 10:06:34: interceptor: Cache returned None. Running cfact.lookup procedure
2020-06-19 10:06:34: cfact.lookup: Called. Checking filename (network-confg) and IP (x.x.x.184)
2020-06-19 10:06:34: cfact.lookup: Requested filename matches the initialfilename. Returning True
2020-06-19 10:06:34: interceptor: cfact.lookup returned (True)
2020-06-19 10:06:34: interceptor: Returning ztp_dyn_file instantiated object
2020-06-19 10:06:34: ztp_dyn_file: Instantiated as (<main.ztp_dyn_file instance at 0x7f58c6ce9dd0>)
2020-06-19 10:06:34: cfact.request: Called with filename (network-confg) and IP (x.x.x.184)
2020-06-19 10:06:34: cfact.request: Filename (network-confg) matches the configured initialfilename
2020-06-19 10:06:34: cfact.request: Generated a TempID with cfact._generate_name: (ZTP-3B5404CCA)
2020-06-19 10:06:34: cfact.request: Generated a SNMP Request with TempID (ZTP-3B5404CCA) and IP (x.x.x.184)
2020-06-19 10:06:34: cfact.request: Returning the below initial config to TFTPy:
#########################
hostname ZTP-3B5404CCA
!
snmp-server community secretcommunity RO
!
end
#########################
2020-06-19 10:06:34: ztp_dyn_file: File size is 71 bytes
2020-06-19 10:06:34: file_cache.store: Storing {1592579194.604807: {'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7f58c6ce9dd0>, 'filename': 'network-confg'}}
2020-06-19 10:06:34: snmp_query._query_worker: Attempting SNMP Query
2020-06-19 10:06:34: interceptor: Called. Checking the cache
2020-06-19 10:06:34: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:34: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:34: ztp_dyn_file.close: Called. File closing.
2020-06-19 10:06:35: interceptor: Called. Checking the cache
2020-06-19 10:06:35: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:35: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:35: interceptor: Called. Checking the cache
2020-06-19 10:06:35: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:35: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:36: interceptor: Called. Checking the cache
2020-06-19 10:06:36: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:36: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:36: interceptor: Called. Checking the cache
2020-06-19 10:06:36: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:36: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:37: interceptor: Called. Checking the cache
2020-06-19 10:06:37: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:37: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:37: interceptor: Called. Checking the cache
2020-06-19 10:06:37: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:37: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:38: interceptor: Called. Checking the cache
2020-06-19 10:06:38: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:38: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:38: interceptor: Called. Checking the cache
2020-06-19 10:06:38: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:38: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:38: interceptor: Called. Checking the cache
2020-06-19 10:06:38: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:38: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:38: interceptor: Called. Checking the cache
2020-06-19 10:06:38: file_cache.get: File (network-confg) requested by (x.x.x.184) found in cache. Checking timeout.
2020-06-19 10:06:38: file_cache.get: Cached file is still within timeout period. Resetting to 0 and returning
2020-06-19 10:06:39: snmp_query._query_worker: SNMP Query Successful (OID: WS_C3850_SERIAL_NUMBER). Host (x.x.x.184) responded with (SCRUBBED)
2020-06-19 10:06:45: file_cache._maintain_cache: Timing out and deleting 1592579194.6:{'ipaddr': 'x.x.x.184', 'file': <main.ztp_dyn_file instance at 0x7f58c6ce9dd0>, 'filename':
'network-confg'}

Switch cli:

Loading network-confg from x.x.x.4 (via Vlan1): !
[OK - 71 bytes]

Press RETURN to get started!

*Jun 19 15:05:52.541: %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
*Jun 19 15:06:06.654: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Discovery Aborted)
ZTP-3B5404CCA>

yea it looks like the switch just won't request the second file. What model and software are you using on the switch? And you said that there were others which did work? Were they the same model and software version?

all of them are the C9200L I am not sure of the firmware version that was on the two that worked. I will check that and get back.

1 think I didn't realize I didnt mention is that all of the above testing was done using a external DHCP server.

This morning I testing using the internal DHCP on the switches that did not work previously and they work fine.

So 2 out of 10 worked fine on using external dhcp and the other 8 work fine when using internal dhcp. Any thoughts on that?

It works every time when the ZTP server hands out the dhcp, not sure what that means thoug.

From CLI of a switch - This one looks like it tries to get the second config. But the output of ztp and the switch show it didnt.

Would you like to enter the initial configuration dialog? [yes/no]:
Loading freeztp_ios_upgrade from x.x.x.4 (via Vlan1): !
[OK - 33 bytes]

Press RETURN to get started!

*Jun 23 17:32:51.244: %IOSXE_INFRA-6-PROCPATH_CLIENT_HOG: IOS shim client 'ngwc fed bipc' has taken 1056 msec (runtime: 636 msec) to process a 'unknown' message
*Jun 23 17:33:55.719: MCP_INSTALLER_NOTICE: NGMOD-Image install passed
*Jun 23 17:33:55.791: AUTOINSTALL: Obtain tftp server address (opt 150) x.x.x.4
*Jun 23 17:33:55.791: PNPA: Setting autoinstall complete to true for x.x.x.4
*Jun 23 17:33:55.398: %INSTALL-5-INSTALL_COMPLETED_INFO: Switch 1 R0/0: install_engine: Completed install one-shot PACKAGE flash:cat9k_lite_iosxe.16.09.03.SPA.bin
*Jun 23 17:33:57.038: %SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x.4/network-confg
Loading network-confg from x.x.x.4 (via Vlan1): !
[OK - 72 bytes]

*Jun 23 17:34:04.031: %SYS-5-CONFIG_I: Configured from tftp://ztpserver/network-confg by console
*Jun 23 17:34:05.039: AUTOINSTALL: Tftp script execution successful for Vl1.
*Jun 23 17:34:54.534: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Discovery Aborted)

ztp show provisioning

##############################################################################################################################
#       Timestamp       |   IP Address   |     Temp ID      |  MAC Address  |  Real IDs  |  Matched Keystore  |    Status    #
#============================================================================================================================#
#  2020-06-23 12:35:00  |  x.x.x.184  |  ZTP-25169FEEAB  |     None      |    None    |        None        |  Incomplete  #
##############################################################################################################################

How do i see what this script looks like.

SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x.4/network-confg

Another test today. on a switch with corect FW
`Loading freeztp_ios_upgrade from x.x.x. (via Vlan1): !
[OK - 33 bytes]

Press RETURN to get started!

ERROR: Software Installation Failed: 35 0

*Jun 25 20:13:23.891: AUTOINSTALL: Obtain tftp server address (opt 150) x.x.x.
*Jun 25 20:13:23.891: PNPA: Setting autoinstall complete to true for x.x.x.
*Jun 25 20:13:24.160: %SCRIPT_INSTALL-3-SCRPT_TYPE_NOT_MATCHED: Script file format invalid: tftp://x.x.x./network-confg
*Jun 25 20:13:23.800: %INSTALL-3-OPERATION_ERROR_MESSAGE: Switch 1 R0/0: install_engine: Failed to install_add_activate_commit package flash:cat9k_lite_iosxe.16.x.03.SPA.bin, Error: install_add_activate_commit : Super package already added. Add operation not allowed. 'install remove inactive' can be used to discard added packages
Loading network-confg from x.x.x. (via Vlan1): !
[OK - 72 bytes]`

It took some timing but If I got the ZTP created hostname and pasted it into the copy command while the config was still available the switch was able to get the final config.

copy tftp:ZTP-251813F0C2-confg running-config

Are you setting your external DHCP server up with the proper DHCP options? Use the ztp request dhcp-option-125 command to see instructions on how to do this.

This is using external DHCP actually. I might should close this and move back over, I am just not sure where the error is, if its in my dhcp options or in the script.

If you have your DHCP options set right, then it shouldn't make a difference. But if it reliably works with internal DHCP, and that works for you, then yea go with that.

Thats the thing, I am not able to use internal DHCP for this. I need it to work with external. I posted a picture of the options set.

This is a issue with the 9200L model switch all other models fully support ztp and the L model does not. Closing issue.