Troubleshooting Commit Scripts
After you enable a commit script and issue a commit command, the commit script takes effect immediately.
Table 14 describes some common problems
that might occur.
Table 14: Troubleshooting
Commit Scripts
Problem | Solution |
|---|
The output of the commit check | display detail command
does not reference the expected commit scripts. | Make sure you have enabled all the scripts by including the file statement for each one at the [edit system scripts
commit] hierarchy level. |
The output contains the error message: error: could not open commit script: /var/db/scripts/commit/filename: No such file or directory | Make sure the file filename is in the /var/db/scripts/commit/ directory on your switch, router, or security device. |
The following error and warning messages appear: error: invalid transient change generated by commit script: filename warning: 1 transient change
was generated without [system scripts commit allow-transients] | One of your commit scripts contains instructions to generate
a transient change, but you have not enabled transient changes. To rectify this problem, take one of the following actions: - Remove the code that generates a transient change from
the indicated script.
- Remove the script.
- Include the allow-transients statement at the [edit system scripts commit] hierarchy level.
|
An expected action does not occur. For example, a warning message does not appear even though the
configuration contains the problem that is supposed to evoke the warning
message. | - Make sure you have enabled the script. Scripts are ignored
if they are not enabled.
To enable a script, include the file filename statement at the [edit system scripts commit] hierarchy
level.
|
- Make sure you have included the required boilerplate in
your script. For more information, see Required Boilerplate for Commit Scripts.
|
- Make sure that the Extensible Markup Language Path (XPath)
expressions in the script contain valid Junos OS command-line interface
(CLI) statements expressed as Junos XML protocol tag elements.
You can verify the XML hierarchy by checking the Junos XML API Configuration Reference or
by issuing the show configuration | display xml operational
mode command.
|
- Make sure that the programming instructions in the script
are referencing the correct context node.
If you nest one instruction inside another, the outer instruction
changes the context node, so the inner instruction must be relative
to the outer. In the following example, the <xsl:for-each> instruction
contains an XPath expression, which changes the context node. So the
nested <xsl:if> instruction uses an XPath expression that
is relative to the interfaces/interface[starts-with(name, 't1-')] XPath expression. <xsl:for-each select="interfaces/interface[starts-with(name, 't1-')]"> <xsl:if test="not(description)">
|