Bug 183429 - pw(8) returns "pw: user 'foo' disappeared during update" after freebsd-update upgrade
Summary: pw(8) returns "pw: user 'foo' disappeared during update" after freebsd-update...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-29 04:00 UTC by Jay Borkenhagen
Modified: 2015-07-13 05:50 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Borkenhagen 2013-10-29 04:00:00 UTC
	
	Following a freebsd-update upgrade from 9.1-RELEASE to 9.2-RELEASE,
	the next attempt to run "pw useradd foo" is met with this error:

	pw: user 'foo' disappeared during update

	I do not see this on machines on which I installed 9.2-RELEASE 
	directly from media.

	At this point the state of user 'foo' is inconsistent:

	[jayb@hungo ~]$ sudo pw useradd foo
	pw: user 'foo' already exists
	[jayb@hungo ~]$ sudo pw usershow foo
	pw: no such user `foo'
	[jayb@hungo ~]$ sudo pw userdel foo
	pw: no such user `foo'
	[jayb@hungo ~]$

Fix: 

I do not know how to fix, i.e. to stop causing the problem.

	Once the situation has developed, the condition can be
	resolved by running vipw(8) to delete the user foo.  At 
	this point the next attempt to run "pw useradd foo"
	succeeds.
How-To-Repeat: 
	Start with a 9.1-RELEASE system, upgrade it to 9.2-RELEASE
	using "sudo freebsd-update -r 9.2-RELEASE upgrade" and
	following the instructions.  It appears that at this point,
	the next attempt to use pw to add a user will fail, even if
	that attempt is being done by adding a new port that
	creates a user, e.g. postfix.  I categorized this as 
	"serious" since it is a latent problem that breaks
	installation of otherwise valid ports.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2015-07-13 05:50:08 UTC
I believe with all recent changes in pw(8) this has been fixed as a side effect
At least I cannot reproduce