Bug 259523 - audio/pulseaudio: pw: user 'pulse' disappeared during update
Summary: audio/pulseaudio: pw: user 'pulse' disappeared during update
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-29 11:37 UTC by John
Modified: 2022-01-25 12:12 UTC (History)
4 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2021-10-29 11:37:04 UTC
While performing "pkg upgrade":

New packages to be INSTALLED:

pulseaudio: 14.2

[198/610] Installing pulseaudio-14.2...
===> Creating groups.
Creating group 'pulse' with gid '563'.
Creating group 'pulse-access' with gid '564'.
Creating group 'pulse-rt' with gid '557'.
===> Creating users
Creating user 'pulse' with uid '563'.
pw: user 'pulse' disappeared during update
pkg: PRE-INSTALL script failed
2021-10-29 09:58:17+0000 UTC 1635501497


While performing "pkg upgrade" second time:

[129/406] Installing pulseaudio-14.2...
===> Creating groups.
Using existing group 'pulse'.
Using existing group 'pulse-access'.
Using existing group 'pulse-rt'.
===> Creating users
Creating user 'pulse' with uid '563'.
pw: user 'pulse' disappeared during update
pkg: PRE-INSTALL script failed
2021-10-29 10:08:30+0000 UTC 1635502110

Unable to complete system update due to the above audio/pulseaudio error so cannot use system.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2021-10-29 15:47:39 UTC
Moin moin 

It might be, that your passwd files are out of sync. Try regenrating it as documented in pwd_mkdb(8)

     Regenerate the password database after manually editing or replacing the
     password file:

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


mfg Tobias
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2021-11-01 05:06:07 UTC
Which version of FreeBSD, exactly?

freebsd-version -kru

uname -aKU

<https://www.freebsd.org/security/advisories/FreeBSD-EN-21:08.freebsd-update.asc>
Comment 3 John 2021-11-01 07:34:55 UTC
(In reply to Tobias C. Berner from comment #1)
 I read the man page for pwd_mkdb.  I do not know nor see what would need to be edited for /etc/master.passwd and do not want to edit not knowing such that cannot access my FreeBSD system.

It appears in some manner as result of the last update attempt that related password files were updated:

 4 -rw-------  1 root  wheel   3118 Oct 29 10:08 /etc/master.passwd
40 -rw-r--r--  1 root  wheel  40960 Oct 29 10:08 /etc/pwd.db
40 -rw-------  1 root  wheel  40960 Oct 29 10:08 /etc/spwd.db
2021-10-30 00:37:18+0000 UTC 1635554238
Comment 4 John 2021-11-01 08:11:48 UTC
(In reply to Graham Perrin from comment #2)


freebsd-version -kru
11.4-RELEASE-p3
11.4-RELEASE-p3
11.4-RELEASE-p4
2021-11-01 07:12:51+0000 UTC 1635750771 

uname -aKU
FreeBSD h440nndytpo3mqsdvcmtoeu3tppdnchwt85snd 11.4-RELEASE-p3 FreeBSD 11.4-RELEASE-p3 #0: Tue Sep  1 08:22:33 UTC 2020     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64 1104001 1104001
2021-11-01 07:13:19+0000 UTC 1635750799

Does this 'uname -aKU' result suggest there is a 11.4-RELEASE-p4 I can upgrade to?

As aside I have script that creates various information when I boot my FreeBSD system.  I have has similar scripts I created and used since started using Unix as my primary system in 1999.  The options of the two commands you asked for are not currently in that script file for those commands, but the --a' is of course for the uname command.  I will add these options to the script file for those commands.  I did not attach the results of script file as past experience suggests only subset of is needed for an issue/bug so I allow what needs to be asked as information needed.  That way clarity for issue is kept rather than people trying to find what information is needed in the extensive output of script my system creates each time started or even when new shell is started.
Comment 5 Graham Perrin freebsd_committer freebsd_triage 2021-11-03 00:41:35 UTC
(In reply to John from comment #3)

/etc/master.passwd
is part of the workaround within FreeBSD-EN-21:08.freebsd-update – see comment 2. 

(In reply to John from comment #4)

> … a 11.4-RELEASE-p4 I can upgrade to? …

11.4-RELEASE-p4 is not the most recent. 

FreeBSD-EN-21:08.freebsd-update mentions 11.4-RELEASE-p8. 

----

First, apply the workaround (comments 1 and 2); then update the system. 

Then, since 11.4⋯ is end of life, it's generally advisable to _upgrade_ to either 12.2-RELEASE or 13.0-RELEASE. 

Re: <https://www.freebsd.org/releases/12.3R/schedule/> please note that 12.3-RELEASE is expected in around a month.
Comment 6 John 2021-11-03 02:44:11 UTC
(In reply to Graham Perrin from comment #5)

If the patch of FreeBSD-EN-21:08.freebsd-update is applied while at 11.4-RELEASE-p3 will that patch carry into p4, p5, p6, p7, and p8?  Likewise if one upgraded to 12.0, 12.1, and 12.2 would the patch carry from being applied in 11.4?

I was aware 12.3 is expected in about month.

I am holding back question(s) about upgrade to 12.x for moment until I clear this bug.
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2021-11-03 06:39:48 UTC
(In reply to John from comment #6)

> … if one upgraded to 12.0, 12.1, and 12.2 …

12.0 and 12.1 are outdated. Please never attempt a major upgrade to an outdated version.
Comment 8 John 2021-11-03 11:24:00 UTC
(In reply to Graham Perrin from comment #7)

When I would upgrade from 11.4 to 12.x I assumed it was better to do a stepping of 11.4 - 12.0, then 12.0 to 12.1, then 12.1 to 12.2 and 12.2 to 12.3 rather than from 11.4 directly to 12.3.  My sense from the comment is not so.  The reason I thought best to step through each .x as noted was to ensure any unique element of upgrade step was not missed that may be missed jumping directly from 11.4 to 12.2/3. The 12.0 and 12.1 releases were current once so makes sense in some ways to step the upgrade than to jump 3/4 releases directly as I assume only a +.1 uprade is tested and not a +.X jump upgrade.
Comment 9 Graham Perrin freebsd_committer freebsd_triage 2021-11-06 23:13:54 UTC
(In reply to John from comment #8)

From 11.4 to an outdated release would not be tested; is not a valid upgrade path.
Comment 10 Adriaan de Groot freebsd_committer freebsd_triage 2022-01-25 12:03:03 UTC
This PR is getting bogged down in chat about FreeBSD version upgrades, rather than the original issue of creating a user for pulseaudio.

- Please check if the problem still exists (and if it does not, close this PR or add a note saying so).
- If the problem **does** still exist, try the following:
  - Look if there is a "pulse" user already on the system, e.g.
    ```
    $ grep pulse /etc/passwd 
    pulse:*:563:563:PulseAudio System User:/nonexistent:/usr/sbin/nologin
    ```
  - Look if there is a user ID 563 already on the system, e.g.
    ```
    $ grep 563 /etc/passwd 
    pulse:*:563:563:PulseAudio System User:/nonexistent:/usr/sbin/nologin
    ```
  - I'm going to assume, since pw is reporting "user disappeared", that the answer to both of the above is "no" and you get no output from grep. If you get any output from grep that does not match the above, you have an unusual or messed-up user-id situation, which you need to resolve first.
  - Create the user by hand (now as root),
    ```
    # pw useradd -n pulse -u 563 -g pulse \
    -d /nonexistent -s /usr/sbin/nologin -c "PulseAudio System User"
    ```
  - Assuming that succeeded, run grep again (the first two steps) to double-check the output. If not, you have an issue with the password subsystem which needs to be resolved first.
  - Now install pulseaudio again. **This** time, since the user already exists, I would expect "Using existing user.." kinds of messages and the installation to succeed.
Comment 11 Adriaan de Groot freebsd_committer freebsd_triage 2022-01-25 12:12:57 UTC
.. upon further reflection prompted by bapt@: read the security advisory Graham Perrin linked it. Then run `pwd_mkdb` as described there (it ensures that the various passwd files and databases are in-sync; take a backup of /etc/ beforehand and then compare contents so you see what changes).