Skip to main content
Nivedha
Staff
Staff
May 27, 2024

Troubleshooting Tip: Unable to backup FortiGate config to external FTP server: 'Send config file to ftp server via vdom root failed. Command fail. Return code 12'

  • May 27, 2024
  • 1 reply
  • 2882 views
Description This article discusses an issue when the backup of the firewall config to the FTP server does not work.
Scope FortiGate.
Solution

To backup config to the FTP server, use this link:

Technical Tip: Backup of configuration file from CLI using FTP

The issue will be based on this setup:

FortiGate 10.14.2.159 ---- FTP server 10.14.2.116

To backup the config to FTP we run the following command:

 

execute backup config ftp <filename> <ftp server>[:ftp port] <username> <password>

Follow this KB article is the error code is 12, If the error code is 5:

Troubleshooting Tip: Unable to backup FortiGate config to external FTP server - Send config file to ftp server via vdom root failed. Command fail. Return code 5

 

Error: 'Send config file to ftp server via vdom root failed. Command fail. Return code 12'


FTP2.PNG

12 FTP_INPUT_ERR Error reading INPUT or STDIN.

 

Generally, error 12 occurs when the destination folder is not available. Do a packet capture on FortiGate:

 

diag sniffer packet any 'host <FTP server>' 6 0 l  


Follow:

Technical Tip: How to import 'diagnose sniffer packet' data to WireShark to convert the sniffer output to PCAP.

From GUI:

Go to Network -> Packet capture (upto 7.0.x models) or Network -> Diagnostics (v7.2.x and above). Put a filter for the FTP server IP as the host

Packet capture will show that the directory is not correct:


Packet capture.PNG
Visit the FTP server and check the correct file directory to use.


Note:

It is also possible to use Filezilla to list the directory that allows access.

    1 reply

    New Member
    May 18, 2026

    I am seeing strange behavior. The Fortinet FW device is reachable some times (e.g. Test -NetConnection) from VMs but not reachable most of the times. At same time the if I check from my VDI, it works.

    The backup happens sometime to FTP server  but most times it fails. E.g. works in afternoon and doesn’t in evening. And no change is settings or code. And there is not activity happening in network that should stop this. As per my VM and FTP SMEs there doesn’t seem to be anything wrong. Scratching my head as to why it works sometimes and why it doesn’t.