Troubleshooting Tip: How to troubleshoot TCL script failure in FortiManager
Description
Â
This article describes how when a TCL Script is running in FortiManager, it is possible to see that it will not install it due to errors like 'running tcl script failed. Reason: Run script fail'.
Â
Follow the recommendations below.
Â
Scope
Â
FortiManager.
Â
Solution
Â
Make sure the FortiGate has an updated and valid user/password under 'Device Manager' of the FortiManager (since v7.6 valid username is required but the credential is not required).
Â
FortiManager v7.4 and below:

Â
Try to log in using the CLI Widget using System Information under the 'Device manager' of the FortiManager.
Â

Â
Ensure connectivity with the user and note that if the user has a Trusted host enabled, it is necessary to add the network segment 169.254.0.0/24.
Â

Â
After validating the user/password and ensuring connectivity is acceptable, it is necessary to know that all TCL scripts may fail due to an invalid command being used.
Â
It is possible to get more details in FortiGate by running the following command.
Share the output with TAC Support if there are any reasons why it is failing.
diagnose debug cli 8
diagnose debug application sshd -1
diagnose debug enable
Running a sniffer on both sides shows the SSH connection and key-exchange between FortiManager and FortiGate over the FGFM tunnel IP addresses:
On FortiManager:
diagnose sniffer packet any 'port 22' 3
On FortiGate:
diagnose sniffer packet any 'port 22' 6 0
Convert the sniffer to a pcap and analyze it in Wireshark. Refer to Technical Tip: How to import 'diagnose sniffer packet' data to WireShark.
FortiManager v7.6 and above:
Starting from FortiManager v7.6, TCL scripts run through the 'newcli over FGFM channel', hence, no need for successful SSH authentication (but it is still necessary to have a valid username under 'Device Manager' of the FortiManager).
Make sure the FGFM tunnel between FortiGate and FortiManager is up. See Troubleshooting Tip: How to troubleshoot connectivity issues between FortiGate and FortiManager.
Run the following debug commands in FortiManager while running a TCL Script to get details of script failures:
diagnose debug application dmworker 255
diagnose debug application depmanager 255
diagnose debug enable
Related documents:
