Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos Platform] Commit failure due to missing file or directory

1

0

Article ID: KB28084 KB Last Updated: 13 Jan 2022Version: 2.0
Summary:

When a file or directory is missing, users receive an error message and command commit fails. This article describes how to rebuild a missing file or directory.

Symptoms:

In Junos OS, there are 50 historical configuration files distributed in the following way:

  • The current active configuration name  "juniper.conf.gz" stored inside /config directory.
  • The lasted 3 rollback configuration name  "juniper.conf.1.gz", "juniper.conf.2.gz", "juniper.conf.3.gz" stored inside  /config directory.
  • Older configuration rollbacks name from  "juniper.conf.4.gz" up to "juniper.conf.49.gz" stored inside /var/db/config/

If the directory /var/db/config or any of its files is missing, a commit failure will ensue and users will see an error message:

"error: error copying files (/config/juniper.conf.3.gz->/var/db/config/juniper.conf.4.gz): No such file or directory" .  

Note: The contents of this folder can be checked running "file list /var/db/config/ " from the operational mode.

Solution:

1. If the /var/db/config/ directory is missing, it needs to be recreated following the below steps:

lab@MX1# run start shell
% su
Password:
root@MX1% cd /var/db

root@MX1% ls -al
total 240
drwxr-xr-x 6 root wheel 512 Aug 30 16:56 .
drwxr-xr-x 32 root wheel 1024 Aug 30 14:51 ..
drwxr-xr-x 2 root wheel 512 Aug 28 10:57 ai_cache
drwxr-xr-x 4 root wheel 512 Aug 28 10:57 appid
drwx------ 5 root wheel 512 Aug 28 10:57 certs
-rw-r--r-- 1 root wheel 116 Aug 30 16:51 commits
-rw-r--r-- 1 root wheel 71111 Aug 30 14:51 dcd.snmp_ix
-rw-r--r-- 1 root wheel 7389 Aug 30 14:51 dcd.snmp_ix.slave
-rw-r--r-- 1 root wheel 27 Aug 30 16:04 eventd_seq
-rw-r--r-- 1 root wheel 16384 Aug 30 14:51 ext_id_map.db
-rw-rw-r-- 1 root ext 6918 Aug 30 16:55 feature.db


root@MX1% mkdir config

root@MX1% ls -al
total 244
drwxr-xr-x 7 root wheel 512 Aug 30 16:56 .
drwxr-xr-x 32 root wheel 1024 Aug 30 14:51 ..
drwxr-xr-x 2 root wheel 512 Aug 28 10:57 ai_cache
drwxr-xr-x 4 root wheel 512 Aug 28 10:57 appid
drwx------ 5 root wheel 512 Aug 28 10:57 certs
-rw-r--r-- 1 root wheel 116 Aug 30 16:51 commits
drwxr-xr-x 2 root wheel 512 Aug 30 16:56 config  <------------------------------ Folder created
-rw-r--r-- 1 root wheel 71111 Aug 30 14:51 dcd.snmp_ix
-rw-r--r-- 1 root wheel 7389 Aug 30 14:51 dcd.snmp_ix.slavev -rw-r--r-- 1 root wheel 27 Aug 30 16:04 eventd_seq
-rw-r--r-- 1 root wheel 16384 Aug 30 14:51 ext_id_map.db
-rw-rw-r-- 1 root ext 6918 Aug 30 16:55 feature.db

root@MX1% exit

exit
% exit
exit

[edit]
lab@MX1# commit
commit complete

2. if the /var/db/config/ directory exists but there are missing files or reports "permission deny" errors, it needs to be delete and recreated using root credentials:

root@MX1> file delete /var/db/config/*  (deletes all files inside directory)
root@MX1> file delete-directory /var/db/config/ (deletes directory)
root@MX1> file make-directory /var/db/config/ (creates directory)

root@MX1# commit
commit complete

 Note: If the error is reported on the backup RE on dual RE platforms like QFX10k, use "request routing-engine login other-routing-engine" prior to the above steps. If the error is reported on specific members of a VC or VCF, the run "request session member member-id" to move to the affected member(s).

Modification History:
2022-01-13: updated entire article.
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search