Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Troubleshoot Junos PyEZ Errors When Configuring Junos Devices

The following sections outline errors that you might encounter when using Junos PyEZ to configure Junos devices. These sections also present potential causes and solutions for each error.

Troubleshoot Timeout Errors

Problem

Description

The Junos PyEZ code generates an RpcTimeoutError message or a TimeoutExpiredError message and fails to update the device configuration.

Cause

The default time for a NETCONF RPC to time out is 30 seconds. Large configuration changes might exceed this value causing the operation to time out before the configuration can be uploaded and committed.

Solution

To accommodate configuration changes that might require a commit time that is longer than the default timeout interval, set the timeout interval to an appropriate value and rerun the code. To configure the interval, either set the Device timeout property to an appropriate value, or include the timeout=seconds argument in the commit() or set() method when you load and commit configuration data on a device. For example:

Troubleshoot Configuration Lock Errors

Problem

Description

The Junos PyEZ code generates a LockError message indicating that the configuration cannot be locked.

Cause

A configuration lock error can occur for the following reasons:

  • Another user has an exclusive lock on the configuration.

  • Another user made changes to the shared configuration database but has not yet committed the changes.

  • The user executing the Junos PyEZ code does not have permissions to configure the device.

Solution

If another user has an exclusive lock on the configuration or has modified the configuration, wait until the lock is released or the changes are committed, and execute the code again. If the cause of the issue is that the user does not have permissions to configure the device, either execute the program with a user who has the necessary permissions, or if appropriate, configure the Junos device to give the current user the necessary permissions to make the changes.

Troubleshoot Configuration Change Errors

Problem

Description

The Junos PyEZ code generates a ConfigLoadError message indicating that the configuration cannot be modified due to a permissions issue.

Cause

This error message might be generated when the user executing the Junos PyEZ code has permission to alter the configuration, but does not have permission to alter the desired portion of the configuration.

Solution

Either execute the program with a user who has the necessary permissions, or if appropriate, configure the Junos device to give the current user the necessary permissions to make the changes.