Description

This article describes the following error message:

warning: Command exited: PID 2552, status 1, command pwd_mkdb error
error: failed to rebuild passwd database for commit

Symptoms

This is a known issue. It is resolved in Junos OS 10.4R9, 11.2R6, 11.3R5, 11.4R2, and 12.1R1.

Solution

The problem is the password database generation tool "pwd_mkdb" ( /usr/sbin/pwd_mkdb ) fails to generate the password databases /etc/pwd.db and  /etc/spwd.db when the temporary file /etc/pwd.db.tmp or /etc/spwd.db.tmp exists.

A workaround:

  1. Remove the following files:
  2. /etc/spwd.db.tmp
    /etc/pwd.db.tmp

  3. Run the commit command.

    For example:

>start shell
% rm -rf /etc/spwd.db.tmp
% rm -rf /etc/pwd.db.tmp
%exit
== >> Attempt to change password and commit
>configure
#set system root-authentication plain-text-password
#commit

Note : If it is a cluster and the commit fails, delete the same files from node 0.


If this workaround does not resolve the issue, perform the following procedure on both nodes:

  1. Reboot the system in single-user mode:

  2. Press Enter to boot immediately, or space bar for command prompt.
    Type '?' for a list of commands, 'help' for more detailed help.
    loader> boot -s

  • At the "Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh" prompt, press ENTER. The prompt will change to  #.

  • Issue the following commands:

# rm -rf /etc/spwd.db.tmp
# rm -rf /etc/pwd.db.tmp

  • Reboot the system.

  • After the device comes back up, you should be able to change the password.