Knowledge Search


×
 

Why do JUNOS upgrades or downgrades sometimes fail with the error "could not open commit script: /var/db/scripts/commit/jais-activate-scripts.slax: No such file or directory"

  [KB11892] Show Article Properties


Summary:
If Advanced Insight Scripts (AI-Scripts) are installed on a JUNOS router, a JUNOS upgrade or downgrade might fail with the message:
mgd: error:   could not open commit script: /var/db/scripts/commit/jais-activate-scripts.slax: No such file or directory
The failure happens during the configuration validation part of the upgrade or downgrade.
Symptoms:
AI-Scripts are installed on a JUNOS router, as shown below from the output of show version
talal@ulm> show version 
Hostname: ulm
Model: m7i
JUNOS Base OS boot [9.1R1.8]
...
JUNOS AIS Script Suite [1.1R1.1]
A software upgrade or downgrade attempt might fail and report that the configuration is not compatible with the software being installed. below is an example of failed downgrade from JUNOS 9.1R1.8 to JUNOS 9.0R2 on an M7i router.
talal@ulm> request system software add /var/tmp/jinstall-9.0R2.10-domestic-signed.tgz 
NOTICE: Validating configuration against jinstall-9.0R2.10-domestic-signed.tgz.
NOTICE: Use the 'no-validate' option to skip this if desired.
Checking compatibility with configuration
...
Hardware Database regeneration succeeded
Validating against /config/juniper.conf.gz
mgd: error: commit-script
mgd: error:   could not open commit script: /var/db/scripts/commit/jais-activate-scripts.slax: No such file or directory
mgd: error: 1 error reported by commit scripts
mgd: error: commit script failure
Validation failed
WARNING: Current configuration not compatible with /var/tmp/jinstall-9.0R2.10-domestic-signed.tgz

If an attempt to uninstall AI-scripts is made under the same conditions, that would fail too and the same error message is displayed.
talal@ulm> request system scripts delete 
Removing package 'jais' ...
NOTICE: uncommitted changes have been saved in /var/db/config/juniper.conf.pre-install
Unmounted /packages/mnt/jais-1.1R1.1 ...
mgd: error: commit-script
mgd: error:   could not open commit script: /var/db/scripts/commit/jais-activate-scripts.slax: No such file or directory
mgd: error: 1 error reported by commit scripts
mgd: error: commit script failure
ERROR: Error during configuration commit
pkg_delete: post-deinstall script returned error status
Solution:
This can happen if the optional knob is not configured under sytem/scripts/commit/file/jais-activate-scripts.slax/
According to the AIS documentation, it is a prerequisite to configure the optional knob.

The optional knob is normally configured inside configuration group juniper-ais under sytem/scripts/commit/file/jais-activate-scripts.slax/
Our lab tests have shown that if it is not present, upgrades or downgrades of JUNOS might fail.

The steps to manually install AI-Scripts on a network device can be summarized to the following :
  1. Configure group juniper-ais, apply it, and commit the configuration
  2. Install the scripts package with request system scripts add package-name
If this order is respected and the optional knob is missing, the commit in step 1 will fail and an error message is displayed.
talal@ulm# commit 
error: could not open commit script: /var/db/scripts/commit/jais-activate-scripts.slax: No such file or directory
error: 1 error reported by commit scripts
error: commit script failure

However, when the order above is not respected, i.e. if the AI-Scripts package is installed before configuring, then no error message is displayed and the operation succeeds.


Here is the AIS-related configuration with optional in bold. 
talal@ulm# show groups         
juniper-ais {
    system {
        scripts {
            commit {
                allow-transients;
                file jais-activate-scripts.slax {
                    optional;
                }
            }
        }
    }
    event-options {
        destinations {
            juniper-aim {
                archive-sites {
                    "scp://login:password@aimserver/Aim_Archive_Location";
                }
            }
        }
    }
}

[edit]
talal@ulm# show | match apply 
apply-groups juniper-ais;

[edit]


The error can be corrected by configuring optional under sytem/scripts/commit/file/jais-activate-scripts.slax/
Related Links: