Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Troubleshooting Commit Scripts

 

After you enable a commit script and issue a commit command, the commit script takes effect immediately.

Table 1 describes some common problems that might occur.

Table 1: 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 commit script is present 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:

  • Include the allow-transients statement at the [edit system scripts commit] hierarchy level.

  • Remove the code that generates a transient change from the indicated script.

  • Disable the script in the configuration.

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.

  1. 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.

  1. Make sure you have included the required boilerplate in your script. For more information, see Required Boilerplate for Commit Scripts.

  1. 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 Developer Reference or by issuing the show configuration | display xml operational mode command.

  1. 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.

    For 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)">

The commit operation fails, and an error message in the system log file indicates:

Process (pid,cscript) attempted to exceed RLIMIT_DATA

When committing a configuration that is inspected by one or more commit scripts, you might need to increase the amount of memory allocated to the commit scripts to accommodate the processing of large configurations.

By default, the maximum amount of memory allocated for the data segment portion of an executed script is half of the total available memory of the system, up to a maximum value of 128 MB. To increase the maximum memory allocated for each executed commit script, configure the max-datasize size statement with an appropriate memory limit in bytes at the [edit system scripts commit] hierarchy level before committing the configuration.