Bug 255540 - net/ntopng: user 'ntopng' disappeared during update
Summary: net/ntopng: user 'ntopng' disappeared during update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Guido Falsi
Depends on:
Reported: 2021-05-02 07:12 UTC by kaan
Modified: 2021-05-02 09:27 UTC (History)
0 users

See Also:
madpilot: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description kaan 2021-05-02 07:12:24 UTC
try to install ntopng on fresh system.
uname -a
13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

pkg -v

pkg install ntopng

New packages to be INSTALLED:
        ntopng: 4.2.d20210309,1

Number of packages to be installed: 1

The process will require 43 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing ntopng-4.2.d20210309,1...
===> Creating groups.
Using existing group 'ntopng'.
===> Creating users
Creating user 'ntopng' with uid '288'.
pw: user 'ntopng' disappeared during update
pkg: PRE-INSTALL script failed
Comment 1 Guido Falsi freebsd_committer 2021-05-02 08:52:00 UTC
The pkg software uses the pw(8) utility to create users during package insstallation. The package can only indicate which user it requires and those tools do all the actual job.

The error message you're getting s actually generated by pw(8), you can check it's source code at `/usr/src/usr.sbin/pw/pw_user.c` lines 1451 and 1813:

errx(EX_NOUSER, "user '%s' disappeared during update", name);

I don't know exactly the cause in your case, but in my experience the most frequent cause is a misalignment between the passwd, master.passwd files and the related db and shadow db files.

You can use pwd_mkdb(8) to force regenerating the DB files before running pkg like this:

/usr/sbin/pwd_mkdb -p /etc/master.passwd

(this is the suggested command line in pwd_mkdb(8))

You can also just call vipw as root, then, changing nothing, save and exit, so DBs are regenerated. (it calls pwd_mkdb in the background after you exit the editor if the file was touched)

Ti go any deeper I think you should file a bug report against pw(8), but before that you should investigate why the error happens, maybe pw(8) should try harder to generate better error messages.
Comment 2 kaan 2021-05-02 09:27:53 UTC
Thank you, this is help