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.
AI-Scripts are installed on a JUNOS router, as shown below from the output of show version
show version
user@host> show version Hostname: host 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 OS 9.1R1.8 to Junos OS 9.0R2 on an M7i router.
user@host> 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.
user@host> 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
This can happen if the optional knob is not configured under system/scripts/commit/file/jais-activate-scripts.slax/.
system/scripts/commit/file/jais-activate-scripts.slax/
According to the AIS documentation, it is a prerequisite to configure the optional knob.
optional
The optional knob is normally configured inside configuration group juniper-ais under system/scripts/commit/file/jais-activate-scripts.slax/.
juniper-ais
Our lab tests have shown that if it is not present, upgrades or downgrades of Juno s OS might fail.
The steps to manually install AI-Scripts on a network device can be summarized to the following:
Configure group juniper-ais, apply it, and commit the configuration.
Install the scripts package with request system scripts add package-name.
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.
user@host# 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.
user@host# 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] user@host# show | match apply apply-groups juniper-ais; [edit]
The error can be corrected by configuring optional under system/scripts/commit/file/jais-activate-scripts.slax/.
2023-04-06: Updated broken link
Manually installing and configuring AI-Scripts on Devices