This article provides information on how to recover when the EX Switch generates an error message "Rotation of old files failed." during a commit.
The EX Switch generates the following error message during a commit:
configuration check succeeds
error: error copying files
(/config/juniper.conf.3.gz->/var/db/config/juniper.conf.4.gz): No such
file or directory
error: rotation of old files failed
Note: This problem can occur on MX routers as well. Please refer to KB28622 if you are seeing this issue on an MX router.
Upgrading the switch to a higher Junos Software Release starting with 10.0S10.1, 10.4R1, and all later releases resolves the issue.
If an upgrade is not feasible then the following workaround can be used:
Workaround:
The follwoing commands are issued in the shell mode of the switch:
user@switch>start shell user root
user@switch%
user@switch% ls -ld db/config
ls: db/config: No such file or directory
user@switch% cd db
user@switch% ls -l
total 8
-rw-r--r-- 1 root wheel 2857 Jul 24 16:48 feature.db
user@switch% cd /var/db/
user@switch% ln -s /config/db/config . <------note the <dot> here :: ln -s /config/db/config <dot>
user@switch%ls -ld config
user@switch%/config/db/config
user@switch%ln -s /config/db/commits . <-------note the <dot> here ln -s /config/db/commits <dot>
user@switch%ls -ld
drwxr-xr-x 2 root wheel 512 Jul 24 16:49 .
user@switch%ls -ld commits
lrwxr-xr-x 1 root wheel 18 Jul 24 16:49 commits -> /config/db/commits
user@switch%pwd
/var/db/
user@switch% ls -l
total 8
lrwxr-xr-x 1 root wheel 18 Jul 24 16:49 commits -> /config/db/commits
lrwxr-xr-x 1 root wheel 17 Jul 24 16:49 config -> /config/db/config
-rw-r--r-- 1 root wheel 2857 Jul 24 16:48 feature.db
user@switch% exit
user@switch>
NOTE:This issue is fixed from 10.0S10.1, 10.4R1 and all later JUNOS releases. If none of the above works, you can try adding the following directories from the top of the directory. Meaning that you will not cd into /var/db/.
lab@re0> start shell user root
Password:
root@re0%
root@re0% mkdir /config/db
root@re0% mkdir /config/db/config
root@re0% exit
Should none of these solutions work. Then open a case with JTAC.