Solved Error adding new user - pw: user 'anne' disappeared during update

k.jacker

Aspiring Daemon

Reaction score: 476
Messages: 741

Hei,

As root, I'm trying to add a new user with adduser but it returnes a strange error when I confirm.
Only the group 'anne' gets created, but nothing more. I checked pw(8) for something helpful as it seems like it's pw creating the error and checked /var/log/messages and /var/log/auth.log but nothing strange there.
Code:
Username   : anne
Password   : *****
Full Name  : Anne
Uid        : 2001
Class      :
Groups     : anne
Home       : /home/anne
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
pw: user 'anne' disappeared during update
adduser: ERROR: There was an error adding user (anne).
Add another user? (yes/no): no
Goodbye!

Anyone who could help? Thanks!
Matthias
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 14,056
Messages: 40,777

Your databases are out of sync. Not sure how this happens but I get it from time to time too. Run /usr/sbin/pwd_mkdb -p /etc/master.passwd. Running vipw(8) and save-and-quit (without actually making any changes) also fixes it (easier to remember).
 
OP
k.jacker

k.jacker

Aspiring Daemon

Reaction score: 476
Messages: 741

Talking about quick help. Thank you SirDice, that worked :)
Solved
 

VASJD

New Member


Messages: 2

Your databases are out of sync. Not sure how this happens but I get it from time to time too. Run /usr/sbin/pwd_mkdb -p /etc/master.passwd. Running vipw(8) and save-and-quit (without actually making any changes) also fixes it (easier to remember).
Thank to you SirDice. I'm very glad with all of you in this list. I've been two times with a doubt and found a brilliant answer: and, of course, problem solution.
 

Mark Novem

New Member


Messages: 2

Just done my upgrade to the latest FreeBSD 6.7 version and when i try to install jenkins i stumbled to this problem. Thanks SirDice it did work on my problem.
 

scottro

Daemon

Reaction score: 970
Messages: 2,123

This just worked for me while upgrading packages on FreeBSD-12.2-RELEASE. Thanks, SirDice. Didn't try vipw, the pwd_mkdb fixed it.
 

richardtoohey2

Aspiring Daemon

Reaction score: 390
Messages: 776

This seems to happen consistently on a fresh install of FreeBSD 12.2 and installing MySQL 5.7 from ports - so make install is running, and at the end:
Code:
===>   Registering installation for mysql57-server-5.7.32
Installing mysql57-server-5.7.32...
===> Creating groups.
Creating group 'mysql' with gid '88'.
===> Creating users
Creating user 'mysql' with uid '88'.
pw: user 'mysql' disappeared during update
===> Creating homedir(s)
install: unknown user mysql
pkg-static: PRE-INSTALL script failed
This seems to get you back on track (well, worked for me):
Code:
# /usr/sbin/pwd_mkdb -p /etc/master.passwd
# make reinstall
 

mrredeyeflight

Member

Reaction score: 1
Messages: 91

Your databases are out of sync. Not sure how this happens but I get it from time to time too. Run /usr/sbin/pwd_mkdb -p /etc/master.passwd. Running vipw(8) and save-and-quit (without actually making any changes) also fixes it (easier to remember).
thank you for this. I appreicate it
 

cbrace

Well-Known Member

Reaction score: 16
Messages: 319

I too encountered this issue just now, installing mariadb from the pkg. The fix above worked for me as well.
 

Jose

Daemon

Reaction score: 1,318
Messages: 1,535

Just got bit by this upgrading to 12.2. The fix above didn't work, all my users were still gone. The following worked
/usr/sbin/pwd_mkdb -p /var/backup/master.passwd.bak. I had to restore /etc/group from /var/backup as well. I made copies of everything first.
 

spork

Active Member

Reaction score: 14
Messages: 163

Just saw it here on 12.2-p10:

Code:
root@nj2 ~]# freebsd-version -u
12.2-RELEASE-p10
[root@nj2 ~]# freebsd-version -k
12.2-RELEASE-p7
[root@nj2 ~]#
[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1
...
Proceed with this action? [y/N]: y
...
[1/28] Installing dbus-1.12.20_5...
===> Creating groups.
Using existing group 'messagebus'.
===> Creating users
Creating user 'messagebus' with uid '556'.
pw: user 'messagebus' disappeared during update
pkg: PRE-INSTALL script failed
[root@nj2 ~]#
[root@nj2 ~]# /usr/sbin/pwd_mkdb -p /etc/master.passwd
[root@nj2 ~]#
[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1
...
[10/28] Installing avahi-app-0.8...
===> Creating groups.
Creating group 'avahi' with gid '558'.
===> Creating users
Creating user 'avahi' with uid '558'.
pw: group `558' does not exist
pkg: PRE-INSTALL script failed
[root@nj2 ~]#
[root@nj2 ~]# /usr/sbin/pwd_mkdb -p /etc/master.passwd
[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1
Proceed with this action? [y/N]: y
...
[1/19] Installing avahi-app-0.8...
===> Creating groups.
Using existing group 'avahi'.
===> Creating users
Creating user 'avahi' with uid '558'.
pw: user 'avahi' disappeared during update
pkg: PRE-INSTALL script failed
[root@nj2 ~]# /usr/sbin/pwd_mkdb -p /etc/master.passwd
[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1
...
[4/19] Installing cups-2.3.3op2...
===> Creating groups.
Creating group 'cups' with gid '193'.
===> Creating users
Creating user 'cups' with uid '193'.
pw: group `193' does not exist
pkg: PRE-INSTALL script failed
[root@nj2 ~]#
[root@nj2 ~]# /usr/sbin/pwd_mkdb -p /etc/master.passwd
[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1
...
Proceed with this action? [y/N]: y
[1/16] Installing cups-2.3.3op2...
===> Creating groups.
Creating group 'cups' with gid '193'.
===> Creating users
Creating user 'cups' with uid '193'.
pw: group `193' does not exist
pkg: PRE-INSTALL script failed
[root@nj2 ~]# /usr/sbin/pwd_mkdb -p /etc/master.passwd

[root@nj2 ~]# pkg install php74-pecl-imagick-3.5.1

Not really any rhyme or reason here. The "fix" of manually regenerating the password db maybe does something? Hard to tell.
 
Top