pulseaudio.service: Start request repeated too quickly.

Bug #1889416 reported by Nafallo Bjälevik
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
fscrypt (Debian)
New
Unknown
fscrypt (Ubuntu)
Confirmed
Undecided
Unassigned
pulseaudio (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

PA doesn't start on it's own after the latest update.

```
nafallo@wendigo:~$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2020-07-29 14:59:19 CEST; 11min ago
TriggeredBy: ● pulseaudio.socket
    Process: 2774 ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal (code=exited, status=1/FAILURE)
   Main PID: 2774 (code=exited, status=1/FAILURE)

Jul 29 14:59:19 wendigo systemd[2664]: pulseaudio.service: Scheduled restart job, restart counter is at 5.
Jul 29 14:59:19 wendigo systemd[2664]: Stopped Sound Service.
Jul 29 14:59:19 wendigo systemd[2664]: pulseaudio.service: Start request repeated too quickly.
Jul 29 14:59:19 wendigo systemd[2664]: pulseaudio.service: Failed with result 'exit-code'.
Jul 29 14:59:19 wendigo systemd[2664]: Failed to start Sound Service.
Jul 29 14:59:20 wendigo systemd[2664]: pulseaudio.service: Start request repeated too quickly.
Jul 29 14:59:20 wendigo systemd[2664]: pulseaudio.service: Failed with result 'exit-code'.
Jul 29 14:59:20 wendigo systemd[2664]: Failed to start Sound Service.
```

But works after starting it manually.

```
nafallo@wendigo:~$ systemctl --user start pulseaudio
nafallo@wendigo:~$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-07-29 15:11:14 CEST; 5min ago
TriggeredBy: ● pulseaudio.socket
   Main PID: 5675 (pulseaudio)
     CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
             └─5675 /usr/bin/pulseaudio --daemonize=no --log-target=journal

Jul 29 15:11:13 wendigo systemd[2664]: Starting Sound Service...
Jul 29 15:11:14 wendigo systemd[2664]: Started Sound Service.
```

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: pulseaudio 1:13.99.1-1ubuntu3.5
ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
Uname: Linux 5.4.0-42-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: nafallo 5675 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed Jul 29 15:11:28 2020
InstallationDate: Installed on 2018-06-27 (763 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: pulseaudio
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/11/2019
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.12.1
dmi.board.name: 0W970W
dmi.board.vendor: Dell Inc.
dmi.board.version: A03
dmi.chassis.type: 10
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr1.12.1:bd12/11/2019:svnDellInc.:pnXPS139370:pvr:rvnDellInc.:rn0W970W:rvrA03:cvnDellInc.:ct10:cvr:
dmi.product.family: XPS
dmi.product.name: XPS 13 9370
dmi.product.sku: 07E6
dmi.sys.vendor: Dell Inc.

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :
Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

For some reason the latest update (1:3.99.1-1ubuntu3.5) break if the user has an encrypted home directory, in my case ext4 encryption.

$ journalctl -xe --user-unit pulseaudio

```
-- Reboot --
Jul 29 14:59:18 wendigo systemd[2664]: Starting Sound Service...
-- Subject: A start job for unit UNIT has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit UNIT has begun execution.
--
-- The job identifier is 25.
Jul 29 14:59:18 wendigo pulseaudio[2681]: Failed to create secure directory (/home/nafallo/.config/pulse): No such file or directory
Jul 29 14:59:18 wendigo systemd[2664]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit UNIT has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jul 29 14:59:18 wendigo systemd[2664]: pulseaudio.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit UNIT has entered the 'failed' state with result 'exit-code'.
Jul 29 14:59:18 wendigo systemd[2664]: Failed to start Sound Service.
-- Subject: A start job for unit UNIT has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit UNIT has finished with a failure.
--
-- The job identifier is 25 and the job result is failed.
Jul 29 14:59:18 wendigo systemd[2664]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit UNIT has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 29 14:59:18 wendigo systemd[2664]: Stopped Sound Service.
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit UNIT has finished.
--
-- The job identifier is 94 and the job result is done.
```

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

The previous version (1:13.99.1-1ubuntu3.4) has the same problem with trying to create ~/.config/pulse before the home directory is available (in this case decrypted). The theory at the moment is that the new patch in 1:13.99.1-1ubuntu3.5 makes the code break earlier and therefor retry faster.

We might want to make sure the service waits for ~/. to be available before trying to create ~/.config/pulse, at least that's my initial thinking.

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

Bug fixed if I move pam_systemd.so below pam_fscrypt.so in /etc/pam.d/common-session. Need to fix /usr/share/pam-configs/systemd so that pam_systemd.so always end up after libpam_fscrypt (and potentially everything else...)

affects: pulseaudio (Ubuntu) → systemd (Ubuntu)
Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

Or possibly we need to fix this with fscrypt being before other additional modules. Adding both systemd and fscrypt on the bug :-)

Revision history for this message
Vladimir Yerilov (openmindead) wrote :

I'm here to just confirm the bug and that your workaround is working.
Thanks.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in fscrypt (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Samuel PHAN (samuel-phan) wrote :

As a workaround, you can try to edit the systemd file "/usr/lib/systemd/user/pulseaudio.service" and add the line:

```
RestartSec=2s
```

Your [Service] section would look like to this:

```
[Service]
ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
Restart=on-failure
RestartSec=2s
RestrictNamespaces=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
# Note that notify will only work if --daemonize=no
Type=notify
UMask=0077
```

Samuel

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

Ehrm. I don't agree with editing the service file that comes from the package and will get overwritten. Ensuring the correct order in the PAM configuration is the correct fix here.

Dan Streetman (ddstreet)
affects: systemd (Ubuntu) → pulseaudio (Ubuntu)
Revision history for this message
Rolf Leggewie (r0lf) wrote :

not a bug in pulseaudio, but confirmed and fixed upstream in fscrypt

Changed in pulseaudio (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :
Changed in fscrypt (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.