Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[SRX] Removing configuration lock on the SRX

0

0

Article ID: KB31330 KB Last Updated: 26 Mar 2020Version: 2.0
Summary:

This article provides information on how to remove a configuration lock which can affect committing a new configuration on the SRX

Symptoms:

In some cases, a commit attempt might fail with the following errors:

error: remote lock-configuration failed on node0

error: configuration database locked by ...
Cause:

There can be different reasons for this issue to occur. Here is just one example.

When a user connects to the CLI, there is a process called mgd which will spawn a new child process for that user. This can be checked from the shell.

1. The user logs in:

root@SRX1% cli
{primary:node0}
root@SRX1>

2. A new mgd process is created:

root@SRX1% ps auxww | grep mgd
root 1271 0.0 2.6 43028 26876 ?? S 6:52AM 0:01.58 /usr/sbin/mgd -N
root 3159 0.0 0.3 43068 2768 ?? Ss 10:37AM 0:00.03 mgd: (mgd) (root)/dev/ttyp1 (mgd)  <<<<< this process is created

3. The user will now want to commit something and will go into configuration mode:

root@SRX1> configure exclusive
warning: uncommitted changes will be discarded on exit
Entering configuration mode

{primary:node0}[edit]
root@SRX1#

4. At this point, something goes wrong, and the user gets disconnected (for some unrelated reason). The user tries to log in again and finds that the node failed over. He still needs to commit his changes.

{primary:node1}
root@SRX2> configure
warning: Clustering enabled; using private edit
warning: uncommitted changes will be discarded on exit
Entering configuration mode

{primary:node1}[edit]
root@SRX2# set interfaces ge-13/0/4 description test

{primary:node1}[edit]
root@SRX2# commit and-quit
node0:
error: configuration database locked by: root terminal u0 (pid 3159) on since 2016-12-15 10:20:02 UTC, idle 00:01:40 exclusive {secondary:node0}[edit]
Users currently editing the configuration:
root terminal u0 (pid 3159) on since 2016-12-15 10:20:02 UTC, idle 00:01:40
exclusive {secondary:node0}[edit]
node1:

error: remote lock-configuration failed on node0

This issue can also occur on a standalone SRX. When the user logs in, he will see a message similar to this one:

root@SRX> configure
Entering configuration mode
Users currently editing the configuration:
root terminal p0 (pid 2304) on since 2016-12-13 17:04:05 UTC, idle 1d 17:09
exclusive [edit]

In some cases, when he tries to commit a change, he will also get a message saying the system cannot lock the configuration.

Solution:

The solution in this case is to clear the lock set by that mgd process. In the case of a standalone SRX, the administrator will issue the following command on the affected SRX:

root@SRX> clear system commit
No commit scheduled

root@SRX> configure
Entering configuration mode <<<< the lock has been removed


[edit]
root@SRX#

When a cluster is used, the recommended action is to use this command on both nodes:

{secondary:node0}
root@SRX1> clear system commit
No commit scheduled

{primary:node1}
root@SRX2> clear system commit
No commit scheduled

{primary:node1}[edit]
root@SRX2# commit and-quit
node0:
configuration check succeeds
node1:
commit complete
node0:
commit complete.                <<<< commit is successful
Exiting configuration mode

 
Modification History:
2020-03-26: Article reviewed for accuracy; it is valid and accurate
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search