Description

This article explains certain failure scenarios where file-transfer to 'archive-site' may fail. However, the 'backup-on-failure' may not kick-in as well.

Symptoms

Assume you have accounting-options configured where files are meant to be exported to 'archive-site'. The


Archive-sites - The router or switch attempts to transfer the file to the first URL specified under 'Archive-sites'

Backup-on-failure - Configure the router to save a copy of the accounting file locally, to the /var/log/pfedBackup directory of the relevant Routing Engine, in the event that file transfer to the remote archive sites cannot be completed. This Knowledge article further clarifies certain scenarios where 'Backup-on-failure' may not actually kick-in despite of file transfer failing to transfer the file to 'Archive-site'


root@router-name> show configuration accounting-options

periodic-refresh disable;

}

file rpm-60-minutes {

  files 24;

  transfer-interval 60;

  start-time "2018-1-1.00:21:00 +0100";

  backup-on-failure {

    master-only;

  }

  push-backup-to-master;

  archive-sites {

    "sftp://[email protected]/in";

  }

}


It may appear the file transfer was successful to the 'archive-site' but it may actually be failed. Such common scenarios include - Disk/Storage full on the archive-site or Read-only permissions on the archive-site


  • Disk/storage full on the 'archive-site'

In this scenario, the SSH to archive-site will work. File transfer may show as successful from the Junos side. However, the file creation has failed on the SFTP server


Mar 27 09:20:43.572 2025 router-name sftp[60944]: remote open("/in/router_name_rpm-5-minutes_20250327_082042"): Failure <--- This log indicates issue on other end where the file creation failed.

Mar 27 09:20:43.589 2025 router-name logger: transfer-file: Transferred /var/log/rpm-5-minutes_1743063642 < --- indicates successful transfer.


  • Read-only permissions to the 'archive-site'

In this scenario as well, the SSH to archive-site will work. However, the file transfer failure happens at the SFTP stage.


Jun 12 09:43:37.134 jtac-mx960-r2601-re0 logger[97391]: transfer-file: Transferred /var/log/rpm-15-minutes_1749701615

Jun 12 09:43:37.126 jtac-mx960-r2601-re0 sftp[97386]: Couldn't write to remote file "/var/tmp//jtac-mx960-r2601-re0_rpm-15-minutes_20250612_041335": Failure


Solution

In both the Scenarios documented here, 'Backup-on-failure' will not kick-in despite. Ideally a backup-on-failure happens in case of:


  • Archive-site getting completely unreachable
  • SSH failing to the archive-site. Meaning the SFTP failing at the SSH stage itself

Backup-on-failure will not kick-in below scenarios if the SSH during SFTP is through however, the failure is on SFTP stage due to any of the below reasons.


  • SFTP failing due to read-only permissions on the SFTP server
  • SFTP failing due to disk full on the SFTP server

Modification History

2025-06-19 : Article Created