/run/user/$ID/pulse owned by root and not by the user

Bug #1197395 reported by Davide Depau on 2013-07-03
326
This bug affects 70 people
Affects Status Importance Assigned to Milestone
elementary OS
Undecided
Unassigned
pulseaudio (Ubuntu)
High
Unassigned
Saucy
Undecided
Unassigned
systemd (Fedora)
Unknown
Unknown
systemd (Ubuntu)
High
Unassigned
Saucy
Undecided
Unassigned

Bug Description

I'm experiencing this problem with Ubuntu Saucy. Some times, when I start a media player (I use Musique), it freezes, as it finds that it cannot write into /run/user/$ID/pulse.
If I change the owner of that directory to me, the media player starts as usual and is able to play music.
I've never had this problem with previous versions of Ubuntu.
Someone says that running PulseAudio with the -D argument changes the owner of that directory, but I didn't try.

This is before manually changing the owner of that directory:
$ musique
Failed to create secure directory (/run/user/1000/pulse): Permission denied+

... # it doesn't crash, it keeps waiting

If needed:
(dmesg attached)
lspci:
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 03)
00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03)
02:00.0 Network controller: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
85:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8072 PCI-E Gigabit Ethernet Controller (rev 10)

From /var/log/syslog:
Jul 3 14:44:12 Davideddu-Laptop pulseaudio[11387]: [pulseaudio] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
Jul 3 14:44:12 Davideddu-Laptop pulseaudio[11387]: [pulseaudio] main.c: User-configured server at {781995e0a8db2617790d55ca51c37499}unix:/run/user/1000/pulse/native, refusing to start/autospawn.
Jul 3 14:46:08 Davideddu-Laptop pulseaudio[11443]: [pulseaudio] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
Jul 3 14:46:08 Davideddu-Laptop pulseaudio[11443]: [pulseaudio] main.c: User-configured server at {781995e0a8db2617790d55ca51c37499}unix:/run/user/1000/pulse/native, refusing to start/autospawn.

This is a fresh installation, I haven't updated it from a previous version. I'm using Ubuntu with Unity, not a derivative.
These are my PPAs:
canonical-qt5-edgers-qt5-proper-saucy.list
dropbox.list
dukto.list
google-earth.list
jd-team-jdownloader-saucy.list
kivy-team-kivy-saucy.list
mitya57-ppa-saucy.list
numix-icon-theme-dev-utouch-saucy.list
otto-kesselgulasch-gimp-saucy.list
phablet-team-desktop-deps-saucy.list
satyajit-happy-themes-saucy.list
steam.list
ubuntu-sdk-team-ppa-saucy.list
ubuntutrucchi.list
ubuntutrucchi-testing.list
ubuntu-wine-ppa-saucy.list
webupd8team-y-ppa-manager-saucy.list

SRU INFORMATION
===============
TEST CASE:
- Ensure that as a normal user "echo $XDG_RUNTIME_DIR" is something like "/run/user/1000"
- do "sudo su -" to get a root shell
- In that root shell, do "echo $XDG_RUNTIME_DIR". In the saucy final package this still gives /run/user/1000, which is incorrect for root and leads to destroying the real
user's runtime dir. With the fixed package it should be empty.

Fix: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/systemd/trusty/revision/58 : This checks if the runtime dir delivered by logind (which is based on the session uid) is owned by the target user, and only puts it in the environment if it is.

Regression potential: The only case where a runtime dir from a different user could work at all is for opening a su/pkexec session as root; but any client using the runtime dir (pulseaudio, dconf, etc.) would destroy the original user's runtime dir, and we don't have any functionality which depends on this. For non-root su/pkexec targets this potentially leads to different errors (inaccessible $XDG_RUNTIME_DIR vs. a nonexisting one). But again the practical impact is limited to things that you do in su/pkexec shells, not in "real" desktop/ssh/VT login sessions.

Davide Depau (depaulicious) wrote :
description: updated
description: updated

Given you have so many PPAs enabled on your system, it is entirely possible that one of those PPAs has updated PulseAudio. Please reply back with the output of "apt-cache policy pulseaudio" so I can find out what version of pulse you have, and where its from.

Thanks.

Davide Depau (depaulicious) wrote :

No, it's not from a PPA:

pulseaudio:
  Installed: 1:3.0-0ubuntu8
  Candidate: 1:3.0-0ubuntu8
  Version table:
 *** 1:3.0-0ubuntu8 0
        500 http://it.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status

Luke Yelavich (themuso) wrote :

Ok then, could you please try testing Pulseaudio 4.0 from ppa:ubuntu-audio-dev/pulse-testing? I must say I am not seeing any such problem similar to this here locally, although I am running Pulse 4.0.

Download full text (5.2 KiB)

Ok, I'm adding it. I didn't have the problem again. I'll try to play music
every time I turn on the PC, and if I won't have problem for almost a week,
I will report it here.

2013/7/9 Luke Yelavich <email address hidden>

> Ok then, could you please try testing Pulseaudio 4.0 from ppa:ubuntu-
> audio-dev/pulse-testing? I must say I am not seeing any such problem
> similar to this here locally, although I am running Pulse 4.0.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1197395
>
> Title:
> /run/user/$ID/pulse owned by root and not by the user
>
> Status in “pulseaudio” package in Ubuntu:
> New
>
> Bug description:
> I'm experiencing this problem with Ubuntu Saucy. Some times, when I
> start a media player (I use Musique), it freezes, as it finds that it
> cannot write into /run/user/$ID/pulse.
> If I change the owner of that directory to me, the media player starts
> as usual and is able to play music.
> I've never had this problem with previous versions of Ubuntu.
> Someone says that running PulseAudio with the -D argument changes the
> owner of that directory, but I didn't try.
>
> This is before manually changing the owner of that directory:
> $ musique
> Failed to create secure directory (/run/user/1000/pulse): Permission
> denied+
>
> ... # it doesn't crash, it keeps waiting
>
> If needed:
> (dmesg attached)
> lspci:
> 00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory
> Controller Hub (rev 07)
> 00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series
> Chipset Integrated Graphics Controller (rev 07)
> 00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset
> Integrated Graphics Controller (rev 07)
> 00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #4 (rev 03)
> 00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #5 (rev 03)
> 00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #6 (rev 03)
> 00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI
> Controller #2 (rev 03)
> 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio
> Controller (rev 03)
> 00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express
> Port 1 (rev 03)
> 00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express
> Port 2 (rev 03)
> 00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express
> Port 3 (rev 03)
> 00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express
> Port 5 (rev 03)
> 00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express
> Port 6 (rev 03)
> 00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #1 (rev 03)
> 00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #2 (rev 03)
> 00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
> Controller #3 (rev 03)
> 00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI
> Controller #1 (rev 03)
> 00:1e.0 PCI bridge: Intel ...

Read more...

Launchpad Janitor (janitor) wrote :

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

Changed in pulseaudio (Ubuntu):
status: New → Confirmed

I meet the same problem with the same version of pulseaudio and permission set uncorrectly as found in my syslog.

pulseaudio:
  Installé : 1:3.0-0ubuntu8
  Candidat : 1:3.0-0ubuntu8
 Table de version :
 *** 1:3.0-0ubuntu8 0
        500 http://fr.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status

after running "musique" I got a hang with :
"Failed to create secure directory (/run/user/1000/pulse): Permission non accordée"

Roland Dreier (roland.dreier) wrote :

affecting me on a system upgraded from raring around saucy-alpha1.

Luke Yelavich (themuso) wrote :

As above, please try testing with Pulseaudio 4.0 from the mentioned PPA.

Iain Lane (laney) wrote :

I am seeing this right now. I got the updated PA from saucy when it was uploaded on the 26th and rebooted on the 27th, so my system was booted with 4.0.

laney@iota> ls -la /run/user/1000
total 0
drwx------ 7 laney laney 160 Jul 27 10:40 ./
drwxr-xr-x 3 root root 60 Jul 27 10:41 ../
drwx------ 2 laney laney 60 Jul 30 12:43 dconf/
dr-x------ 2 laney laney 0 Jul 27 10:40 gvfs/
drwx------ 2 laney laney 40 Jul 27 10:40 gvfs-burn/
drwx------ 2 laney laney 120 Jul 27 10:40 keyring-ibRVX2/
drwx------ 2 root root 100 Jul 27 10:40 pulse/
lrwxrwxrwx 1 root root 17 Jul 27 10:41 X11-display -> /tmp/.X11-unix/X0=

laney@iota> sudo ls -la /run/user/1000/pulse
[sudo] password for laney:
total 4
drwx------ 2 root root 100 Jul 27 10:40 .
drwx------ 7 laney laney 160 Jul 27 10:40 ..
srwxrwxrwx 1 laney laney 0 Jul 27 10:40 dbus-socket
srwxrwxrwx 1 laney laney 0 Jul 27 10:40 native
-rw------- 1 laney laney 5 Jul 27 10:40 pid

laney@iota> sudo more /run/user/1000/pulse/pid
2198

laney@iota> ps faux | grep 2198
laney 2198 0.0 0.0 375976 1140 ? Sl Jul27 0:32 /usr/bin/pulseaudio --start --log-target=syslog

So it's started correctly as my user but the directory has the wrong permissions. Could this be a bug in lightdm?

David Henningsson (diwic) wrote :

> So it's started correctly as my user but the directory has the wrong permissions. Could this be a bug in lightdm?

At least it can't be a bug in PulseAudio, because PulseAudio shouldn't have the permission to create that directory with those permissions, right?

Iain Lane (laney) wrote :

When I press the media keys I can hear the 'pip' sound telling me what the volume will be, so somehow that can use the sound hardware.

Thinking about it, while I can't be sure, it seems quite unlikely that sound would have been broken for me for a week without me noticing (implied if it happened at login time). I wonder if it broke somehow at runtime.

laney@iota> loginctl show-session c2
Id=c2
Timestamp=Sat 2013-07-27 10:41:27 BST

Davide Depau (depaulicious) wrote :

> At least it can't be a bug in PulseAudio, because PulseAudio shouldn't have the permission to create that directory with those permissions, right?

I agree with you, but what else could make it owned by root? Or PA is started as root before the DM is started, and maybe it doesn't remove it after terminating/crashing, or the DM does something nasty...
A workaround could be a script runned *after* login and whitelisted in /etc/sudoers.d that checks the permissions of that directory.

Luke Yelavich (themuso) wrote :

Pulseaudio is run as the logged in user. Pulse itself will refuse to start as root if system mode is not enabled in the config. I think this is happening post pulse start, although I have no idea what the problem could be, and I haven't experienced this problem myself.

Davide Depau (depaulicious) wrote :

On Thu, Aug 1, 2013 at 12:29 AM, Luke Yelavich
<email address hidden>wrote:

> Pulseaudio is run as the logged in user. Pulse itself will refuse to
> start as root if system mode is not enabled in the config. I think this
> is happening post pulse start, although I have no idea what the problem
> could be, and I haven't experienced this problem myself.
>

It may be a media player started as root! Maybe if a media player is
started as root could change the owner of that directory to root..

Luke Yelavich (themuso) wrote :

On Thu, Aug 01, 2013 at 08:39:59AM EST, Davide Depau wrote:
> It may be a media player started as root! Maybe if a media player is
> started as root could change the owner of that directory to root..

If a media player was started as root, libpulse would notice that pulseaudio is not running for root, and attempt to spawn a new instance of pulseaudio, which likely wouldn't work due to the conditions I outlined in my comment earlier.

Antti Kaijanmäki (kaijanmaki) wrote :

OK, hit this today. Never seen it before. I started to have weird problems with Google Hangout; the plugin failed to start on both
firefox and chromium. Manually starting the plugin from command line I got:

$ /opt/google/talkplugin/GoogleTalkPlugin
Failed to create secure directory (/run/user/1000/pulse): Permission denied

There I figured out there is something wrong with pulse:
$ pulseaudio --check
E: [pulseaudio] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied

$ ls -lah /run/user/1000/
drwx------ 2 root root 100 elo 13 11:31 pulse

Removing the directory fixed the problem with GoogleTalk. I guess all the programs using pulse were affected.

Everything was working just fine yesterday. This morning I noticed my laptop had apparently run out of battery. Pluggin in the power chord and power up the machine it seemed that unity did not start straight away. I'm not sure what the failsafe error session looks like, but at least I first saw a bunch of undecorated problem report windows. So I would guess that the first session was run as root or something. Anyway after that the normal unity session started and I was greeted with this:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1211674

So, could it be that at some error situation the X session is started as root and pulse somehow creates it's /run/user/1000/pulse with root permissions at situation like this?

tags: added: apport-collected saucy

ApportVersion: 2.12-0ubuntu3
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: antti 9912 F.... pulseaudio
 /dev/snd/pcmC1D0c: antti 9912 F...m pulseaudio
 /dev/snd/pcmC1D0p: antti 9912 F...m pulseaudio
 /dev/snd/controlC0: antti 9912 F.... pulseaudio
DistroRelease: Ubuntu 13.10
InstallationDate: Installed on 2013-08-06 (6 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130805)
MarkForUpload: True
Package: pulseaudio 1:4.0-0ubuntu1
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 3.10.0-6.17-generic 3.10.3
Tags: saucy
Uname: Linux 3.10.0-6-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
dmi.bios.date: 04/18/2013
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A08
dmi.board.name: 0PJHXN
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: 0.1
dmi.modalias: dmi:bvnDellInc.:bvrA08:bd04/18/2013:svnDellInc.:pnDellSystemXPSL322X:pvr:rvnDellInc.:rn0PJHXN:rvrA00:cvnDellInc.:ct8:cvr0.1:
dmi.product.name: Dell System XPS L322X
dmi.sys.vendor: Dell Inc.

apport information

apport information

apport information

apport information

apport information

gururise (gururise) wrote :

This bug happened to me on upgrade to saucy daily build (10/13/2013)

David Henningsson (diwic) wrote :

There was something upstream that looked somewhat related:

"
Ok, got the error: the systemd pam module in /etc/pam.d/common-session does not create a secure run dir in /run/user for every logged in user.
So pulse is complaining about access .
Deleted the systemd line in /etc/pam.d/common-session makes all work well.
Maybe it's because this is on multi-user (multiseat) computers.
"

If any of you can reproduce this, can you check if this workaround works?

Source: http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-October/018970.html

Ales (w-ales) wrote :

Fixed by deleting the directory '/run/user/1000/pulse'.
Then I had to kill vlc (VLC media player) process that was waiting endlessly saing "Failed to create secure directory (/run/user/1000/pulse)".
But I think after reboot it will be the same again.

Alexander List (alexlist) wrote :

Hit this bug running latest Saucy, with distro pulseaudio after a cold reboot.

pulseaudio:
  Installed: 1:4.0-0ubuntu6
  Candidate: 1:4.0-0ubuntu6
  Version table:
 *** 1:4.0-0ubuntu6 0
        500 http://tw.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status

What I did (don't know if it's related / required to trigger the bug):

- close lid of my Thinkpad X201 while docked
- undock TP
- open TP next morning, LEDs start up but sceen stays dark
- need to hard reboot (4s on power button)
- screen is set to darkest setting
- Ubuntu boots up, but above Pulseaudio problem

Alexander List (alexlist) wrote :

Syslog says:

Oct 22 12:01:51 thinkpad pulseaudio[7500]: [pulseaudio] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
Oct 22 12:01:51 thinkpad pulseaudio[7500]: [pulseaudio] main.c: User-configured server at {8fd1761c7e3ddb8d6613834f51480041}unix:/run/user/1000/pulse/native, refusing to start/autospawn.

Alexander List (alexlist) wrote :

Workaround: I removed the offending directory, and pulse immediately created one owned by the right user. Even after a reboot, no issues here.

Ales (w-ales) wrote :

I can confirm that. Deleting the directory '/run/user/1000/pulse' is apparently enough. The problem is solved for good I guess.

duportail (guy-linux-service) wrote :

The error stays, even in fully updated xubuntu 13.10, on multiseatcomputer.
Log in a first user, the dir /run/user/1001 is created.
Logout this user and login with another user, pulse error shows up in syslog complaining access to this 1001 dir.
Delete this dir, reboot and do the same logins and logout, same problems.
Seems that this libpam-systemd module is not creating a /run/user/dir for every user.Maybe this module is creating dirs upon x displays or something.
In ubuntu 13.04 these dirs were created according the usernames.
Again, disabling this module in pam.d solves the problem.

Laurent Séguin (cybersdf) wrote :

I don't know if it is related, but under XFCE the "indicator-sound" is not functional (luckily hotkeys work).

L. (nemosdca) wrote :

After updated to ubuntu 13.10 I also have this issue. The permission of the directory (/var/run/user/1000/pulse) was changed to root, every time I run synaptic, from the gnome-flashback menu in the panel.

From the menu synaptic is invoked by pkexec. I tried gksudo synaptic then no such problem, i.e. the directory remians owned by myslef. I think it may be a problem caused by pkexec

Kootee (kootee) wrote :

I think problem is connected with system crash. I also musted do hard reboot of my computer, because after wake-up my usb WiFi didn't work and system didn't wanted to reboot (even with root privilages). So after some minutes of waiting i've pressed power button and after new boot got this error.

Y. Leretaille (yleretaille) wrote :

Just had the same problem after a (normal) restart on a Macbook Retina 10,1. Sound wasn't working anymore and most applications using sound hung up/waited for a ling time and then crashed (most annoyingly flashplayer, which caused firfox to hang). After deleting the folder pulse, sound instantily worked again.

Ryan Baxter (rbryanbaxter) wrote :

I had this happen after a failed attempt to put my computer into standby that required a force poweroff.

Scorpil (scorpil) wrote :

Same here: after failed attempt to suspend my PC, directory /run/user/1000/pulse was owned by root.
I've just installed system yesterday (fresh one, not upgraded from previous version).

I've installed only one program that has anything to do with pulseaudio: skype (from repo, not official deb package).
Anyone experiencing this issue installed skype recently?

Philip Aston (philipa) wrote :

Yes - same for me as #37,#38 after failing to enter standby / forced power off.

Horst Schirmeier (horst) wrote :

Same here, had several standby issues before seeing this. Dell Latitude E6400, Ubuntu 13.10 (saucy) 64-bit. Temporary workaround: "sudo chown -R 1000:1000 /run/user/1000".

wizzor (visa-parviainen) wrote :

I can reconfirm.

Also, other users have pointed out putting the lid down while docked, which results in a crash, having to hard-reboot and on restart find this problem.

This also is exactly how my problem appeared. I think I closed the lid first, then docked, though.

Clean install 64b, Lenovo X220 w. dock.

jnns (jnns) wrote :

Problem occurs on a Lenovo Thinkpad X230 as well.

jradwans (jradwans) wrote :

I have the same problem with FLash in all Web Browsers :(

The problem starts after upgrade to ubuntu 13.10 (32bit)

My notebook PacardBell Intel i3-2330M 4x2,2GHz
Intel Sandybridge Mobile

patrycja@patrycja-Satellite-L300:~$ ls -l ./.dmrc
-rw-r--r-- 1 patrycja patrycja 93 lis 9 21:42 ./.dmrc
patrycja@patrycja-Satellite-L300:~$ ls -l /home
razem 12
drwxr-xr-x 80 patrycja users 12288 lis 9 21:42 patrycja
patrycja@patrycja-Satellite-L300:~$ pulseaudio --check
E: [pulseaudio] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Brak dostępu

TooDiesel (zotovd) wrote :

I've also installed skype recently (before upgrading), and the issue has affected me since upgrading to ubuntu 13.10

Y. Leretaille (yleretaille) wrote :

Reencountered the same problem again today (again on my MPr 15"). I _did_ shutdown the computer properly yesterday evening, but I'm pretty sure that I closed the lid immediatly after clicking on shutdown.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High

Hi,

It's a regression in the pam module for systemd: https://bugzilla.redhat.com/show_bug.cgi?id=753882

It affects all distributions afaik and it can make any app/package using XDG_RUNTIME_DIR crash if it's used with root privileges (including dconf)...

This is a huge bug. I think the most relevant person to look into this on your side is Martin Pitt. Let us know if we can help on our side. As always we're available at #linuxmint-dev on irc.spotchat.org.

Here's a quick way to troubleshoot it:

echo $XDG_RUNTIME_DIR
sudo su -
echo $XDG_RUNTIME_DIR

In raring, this returns different paths. In saucy they collide.

This is because /etc/pam.d/common-session* no longer use Ubuntu's libpam-xdg-support (xdg_support.so) but the systemd pam module.

As far as I understand it from the https://bugzilla.redhat.com/show_bug.cgi?id=753882, this isn't actually a bug in systemd, but a change by design.

We're considering solutions in Mint and we'd love to talk to you about it. We've a few ideas we can run by you and it would be better for everyone if we tackled this the same way in Saucy/Petra and got involved in the upstream discussion.

Changed in systemd (Ubuntu):
status: New → Triaged
importance: Undecided → High
David Henningsson (diwic) wrote :

Aha, thanks for that. I've been trying to find a way to reproduce the bug and with the help of comment #46 I got one that worked for me:

sudo su -
pacmd list

This will result in an error message and the directory being owned by root, which screws up further connections.

This does not happen when trying to use the native/normal protocol (e g used by paplay or pactl), because that connection, I believe, uses the PULSE_SERVER x11 property ( see "xprop -root | grep PULSE_SERVER" ).

Pacmd goes straight ahead and calls pa_runtime_path which does a chown on the directory, and normal clients can do that in more unusual situations too, e g if there is no such x11 property.

Please don't use that as a solution... it's just for the purpose of troubleshooting:

- Add the following to /etc/profile

if [ "`id -u`" -eq 0 ]; then
  mkdir -p /run/user/0
  XDG_RUNTIME_DIR='/run/user/0'
fi

- log out and log back in.

This should force the system to behave like it did in raring. So if you're joe and your uid is 1000, it looks like this:

user -> /run/user/1000
sudo -> /home/joe/.cache (which was really bad.. but heh, at least it worked)
gksu -> /root/.cache
su - -> /run/user/0

You can test that by running a script or a program which calls g_get_user_runtime_dir() from glib and outputs it somewhere you can see.

Here's an example (main.c):

#include <stdio.h>
#include <stdlib.h>
#include <glib.h>

int main(void)
{
  const char * runtime_dir = g_get_user_runtime_dir();
  char * cmd = g_strdup_printf("notify-send 'Runtime directory is %s'", runtime_dir);
  FILE *fp = popen(cmd, "r");
  pclose(fp);
  exit(0);
}

Compile it with "gcc -Wall main.c $(pkg-config --cflags --libs glib-2.0)", you'll need the glib dev package installed.

Then mv a.out somewhere in /usr/bin and run that as yourself, with sudo, with gksu and as root behind su -.

^^ this is mostly for the Ubuntu developers by the way. Please don't modify your /etc/profile unless you know your way around the tty consoles and how to repair cache/run permissions. You could find yourself unable to log back in.

David Henningsson (diwic) wrote :

Ok, here's my take on the problem:

http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-November/019121.html

Let's give Lennart a day or two to respond, if he does not, let's deploy the patch.

Martin Pitt (pitti) on 2013-11-13
Changed in systemd (Ubuntu):
milestone: none → ubuntu-13.11
assignee: nobody → Martin Pitt (pitti)
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

Patch sent to RedHat bug, and applied locally in my systemd packaging git. With that I think we shoudln't work around this in pulse. David's proposed patch might still be useful for upstream pulse though, if upstream systemd refuses to apply this.

Changed in systemd (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
status: In Progress → Fix Committed
Changed in pulseaudio (Ubuntu):
status: Triaged → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 204-5ubuntu6

---------------
systemd (204-5ubuntu6) trusty; urgency=low

  * Add pam-check-runtime-dir-user.patch: Don't set an existing
    $XDG_RUNTIME_DIR in the PAM module if it isn't owned by the session user.
    Otherwise su sessions get a runtime dir from a different user which leads
    to either permission errors or scribbling over the other user's files.
    (LP: #1197395)
  * Update debian/extra/60-keyboard.hwdb from current upstream trunk:
    - Fix Lenovo Z370 (LP: #1245189)
 -- Martin Pitt <email address hidden> Wed, 13 Nov 2013 14:00:55 +0100

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released

Hi Martin,

Thanks for stepping up on this.

I think Colin is right over on https://bugzilla.redhat.com/show_bug.cgi?id=753882, you need to check the UID. I added a comment there with an example where permissions on the runtime dir itself are fine.

Hi Martin,

Just to echo my comment on bugzilla. I reviewed the patch again and you're entirely right, it deals with the problem pretty well. Sorry about the confusion. The patch looks good.

David Henningsson (diwic) wrote :

I wouldn't mind a Saucy SRU for this. It seems to hit quite a few people.

Launchpad Janitor (janitor) wrote :

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

Changed in pulseaudio (Ubuntu Saucy):
status: New → Confirmed
Changed in systemd (Ubuntu Saucy):
status: New → Confirmed
Ville Ranki (ville-ranki) wrote :

For end user this is visible as any application (rhythmbox, flash in browser, etc) freezing totally if trying to play audio. It would be really good idea to update systemd on Saucy asap.

xan (xan-zappa) wrote :

Hi there,
just tried this evening to read a film with Totem and VLC - and got this bug, too.

Fyi, if it helps, here is the terminal output I got when trying to read a film with VLC:

Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
Failed to create secure directory (/run/user/1000/pulse): Permission non accordée
[0xaf054be0] pulse audio output error: PulseAudio server connection failure: Connexion refusée
Failed to create secure directory (/run/user/1000/pulse): Permission non accordée
[0x9fc5f70] access_http access error: error: HTTP/1.1 403 Forbidden
[0x9fc5f70] access_http access error: error: HTTP/1.1 403 Forbidden
[0x9fc5f70] access_mms access error: invalid chunk FATAL (0x3f3c)
[0x9fc5f70] access_mms access error: header size == 0
[0xa136978] main demux meta error: no suitable access module for `http://services.tvrage.com/feeds/search.php?show=Misfits'

thanks in advance for the help =)

Martin Pitt (pitti) on 2013-12-05
Changed in pulseaudio (Ubuntu Saucy):
status: Confirmed → Invalid
Martin Pitt (pitti) wrote :

Uploaded fix for saucy, now waiting for SRU team to review/accept.

Changed in systemd (Ubuntu Saucy):
status: Confirmed → In Progress
description: updated

Hello Davide, or anyone else affected,

Accepted systemd into saucy-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/systemd/204-0ubuntu19.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Saucy):
status: In Progress → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) on 2013-12-10
description: updated
Id2ndR (id2ndr) wrote :

The packages from -proposed fixed the bug for me after rebooting the computer.

Martin Pitt (pitti) on 2013-12-12
tags: added: verification-done
removed: verification-needed
Steve White (stevan-white) wrote :

Hi, with some difficulty I installed the -proposed packages for saucy having to do with systemd.
This is a Lenovo E135 running Saucy.

This cleared up several problems for me, some related to sound, some not obviously related.

One not mentioned here exactly:
FlashPlugin in Firefox made like an old TV showing static, and the message
   "an error occurred, try again later"
(this message has been reported appearing in other situations, too.)

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 204-0ubuntu19.1

---------------
systemd (204-0ubuntu19.1) saucy-proposed; urgency=low

  * Add pam-check-runtime-dir-user.patch: Don't set an existing
    $XDG_RUNTIME_DIR in the PAM module if it isn't owned by the session user.
    Otherwise su sessions get a runtime dir from a different user which leads
    to either permission errors or scribbling over the other user's files.
    (Backported from current trusty package) (LP: #1197395)
  * debian/extra/60-keyboard.hwdb: Backport latest maps from trusty, as per
    standing SRU exception:
    - Fix Lenovo Z370 (LP: #1245189)
    - Add Toshiba Satellite U940
 -- Martin Pitt <email address hidden> Fri, 06 Dec 2013 08:37:14 +0100

Changed in systemd (Ubuntu Saucy):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Dariusz (milley) wrote :

This bug affects me today on actual elementary 0.3 freya

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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