Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"bwrap: Can't make symlink at /var/run: File exists" when XDG_RUNTIME_DIR starts with /var/run/ #2200

Closed
KD0BPV opened this issue Oct 6, 2018 · 27 comments
Labels
sandbox issue related to sandbox setup

Comments

@KD0BPV
Copy link

KD0BPV commented Oct 6, 2018

Linux distribution and version

Gentoo testing

Flatpak version

1.0.2, 1.0.3, 1.0.6

Description of the problem

Some apps fail to start with error bwrap: Can't make symlink at /var/run: File exists
So far, I've had this issue with org.nextcloud.Nextcloud , com.github.wwmm.pulseeffects, com.discordapp.Discord

Steps to reproduce

  1. flatpak install org.nextcloud.Nextcloud
  2. flatpak run org.nextcloud.Nextcloud
@alexlarsson
Copy link
Member

I believe this might be fixed by #2160, which is in the 1.0.3 release. Can you test that?

@matthiasclasen matthiasclasen added the sandbox issue related to sandbox setup label Oct 10, 2018
@KD0BPV
Copy link
Author

KD0BPV commented Oct 10, 2018

1.0.3 isn't available on the flatpak-overlay yet, but I'll try a manual build and see what happens.

@KD0BPV
Copy link
Author

KD0BPV commented Oct 10, 2018

Issue still exists with 1.0.3. On a whim, I tried running Nextcloud again via sudo flatpak run org.nextcloud.Nextcloud and that worked. As such, I then rolled back to 1.0.2-r1 from flatpak-overlay and tried it there. Nextcloud worked with that too. Looking at the ebuild, it looks like the fix you were talking about was backported to 1.0.2. I think this rules out #2160 as the cause?

@YogSottot
Copy link

flatpak run org.telegram.desktop
bwrap: Can't make symlink at /var/run: File exists
Flatpak 1.0.4

gentoo

@omichalek
Copy link

omichalek commented Dec 1, 2018

Linux distribution and version

opensuse Tumbleweed
Linux 4.19.2-1-default #1 SMP PREEMPT Tue Nov 13 20:56:49 UTC 2018 (8adee6e) x86_64 x86_64 x86_64 GNU/Linux

Flatpak version

Flatpak 1.0.5

Description of the problem

The program does not start, just recently it was working however... it is completely unpredictable to me.

Steps to reproduce

~$ flatpak run org.darktable.Darktable 
bwrap: Can't make symlink at /var/run: File exists

more info:

~$ ls -al /var/run
lrwxrwxrwx 1 root root 4 dub 24  2018 /var/run -> /run

edit, more info:

~$ flatpak info --show-permissions org.darktable.Darktable

[Context]
shared=network;ipc;
sockets=x11;
filesystems=xdg-run/dconf;host;~/.config/dconf:ro;

[Session Bus Policy]
ca.desrt.dconf=talk
org.freedesktop.secrets=talk
org.gtk.vfs=talk
org.gtk.vfs.*=talk

[Environment]
DCONF_USER_CONFIG_DIR=.config/dconf

@KD0BPV
Copy link
Author

KD0BPV commented Dec 21, 2018

Now I'm getting this with com.discordapp.Discord too, which was working perfectly just yesterday.

@sumdog
Copy link

sumdog commented Jan 28, 2019

I'm experiencing this problem currently on Gentoo:

layman -o https://raw.githubusercontent.com/fosero/flatpak-overlay/master/repositories.xml -f -a flatpak-overlay
emerge -av flatpak
flatpak install --user flathub com.github.bleakgrey.tootle
flatpak run com.github.bleakgrey.tootle
bwrap: Can't make symlink at /var/run: File exists

I'm running flatpak-1.0.6

What's the current workaround for this issue?

@sumdog
Copy link

sumdog commented Jan 28, 2019

I realized that my Gentoo overlay hadn't synced correctly for some reason and I didn't have the option of flatpak 1.2.0. I have since added it to accept keyword, ran flatpak uninstall tootle and then reinstalled it. I still run into the same issue:

selection_245

flatpak: 1.2.0
ostree: 2019.1

@duckinator
Copy link

Running into the same problem with com.slack.Slack from flathub on Fedora 29.

I do not have the problem with org.signal.Signal from flathub, on the same system.

@ph1lt0r
Copy link

ph1lt0r commented Feb 1, 2019

I have the same exact issue on Gentoo Linux as well on flatpak 1.0.6 (what's in the gentoo overlay). I am running the moonlight game streaming application. However, if I xhost and run as root, it will work.

@duckinator
Copy link

After seeing PR #2710, and that it was supposed to fix it by basically resolving the symlink, I figured out a workaround: When running things via flatpak, change $XDG_RUNTIME_DIR to use the real path.

E.g.,

~$ echo $XDG_RUNTIME_DIR 
/var/run/user/1000
~$ file /var/run
/var/run: symbolic link to ../run
~$ org.gnome.Fractal 
bwrap: Can't make symlink at /var/run: File exists
~$ env XDG_RUNTIME_DIR=/run/user/1000 org.gnome.Fractal
~$

@omichalek
Copy link

After seeing PR #2710, and that it was supposed to fix it by basically resolving the symlink, I figured out a workaround: When running things via flatpak, change $XDG_RUNTIME_DIR to use the real path.

E.g.,

~$ echo $XDG_RUNTIME_DIR 
/var/run/user/1000
~$ file /var/run
/var/run: symbolic link to ../run
~$ org.gnome.Fractal 
bwrap: Can't make symlink at /var/run: File exists
~$ env XDG_RUNTIME_DIR=/run/user/1000 org.gnome.Fractal
~$

Thank you for the tip!

A suggestion for the developers: put a mention of the XDG_RUNTIME_DIR variable into the error message!

@TingPing
Copy link
Member

Anyway this can be closed, it will be fixed in the next release. Workaround above in the meantime.

@probonopd
Copy link

probonopd commented Sep 15, 2019

I am runnnig into this as well:

cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

cat /cdrom/.disk/info 
Xubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)

sudo add-apt-repository -y ppa:alexlarsson/flatpak
sudo apt update

sudo apt-get -y install flatpak

flatpak --version
Flatpak 1.4.2

flatpak install flathub org.gnome.gedit
flatpak run org.gnome.gedit

bwrap: Can't make symlink at /var/run: File exists

me@host:~$  ls -al /var/run
lrwxrwxrwx 1 root root 4 Feb 10  2019 /var/run -> /run

@probonopd
Copy link

Now for something more drastic:

sudo rm -rf /var/run

flatpak run org.gnome.gedit

(...)

(flatpak run:12992): GLib-GIO-CRITICAL **: 12:01:55.475: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

** (flatpak run:12992): CRITICAL **: 12:01:55.475: polkit_authority_register_authentication_agent_with_options_sync: assertion 'POLKIT_IS_AUTHORITY (authority)' failed
Segmentation fault

@probonopd
Copy link

probonopd commented Sep 15, 2019

Same result on Ubuntu 19.04 (Disco Dingo) Live ISO and Flatpak 1.2.4:

https://asciinema.org/a/XSmQ2WY4ha9T5ebKm5PBy3AwE

@refi64
Copy link
Collaborator

refi64 commented Sep 15, 2019

sudo rm -rf /var/run basically just deleted almost every daemon communication socket, it's kinda a miracle your system didn't crash.

@probonopd
Copy link

I have just done this on a Live ISO (like I do all of my computing), so after the next reboot the system is in factory-new state.

@tallero
Copy link

tallero commented Jan 17, 2020

sudo rm -rf /var/run basically just deleted almost every daemon communication socket, it's kinda a miracle your system didn't crash.

/var/run is a symlink of /run. On arch it is recreated at every boot. In any case that won't solve the problem.

Source

@tallero
Copy link

tallero commented Mar 2, 2020

This still happens on Archlinux as of today.

@probonopd
Copy link

probonopd commented Mar 22, 2020

I am running into the same issue on the Xubuntu 18.04.2 LTS Live ISO:

me@host:~$ flatpak --version
Flatpak 1.6.2 # from PPA

me@host:~$ flatpak run --user --command=bash org.gnome.gedit

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/me/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

bwrap: Can't make symlink at /var/run: File exists

Even if I do

me@host:~$ sudo rm -rf /var/run

me@host:~$ sudo ln -s /run /var/run

me@host:~$ echo $XDG_RUNTIME_DIR 
/run/user/999
me@host:~$ file /var/run
/var/run: symbolic link to /run

me@host:~$ env XDG_RUNTIME_DIR=/run/user/999 flatpak run --user --command=bash org.gnome.gedit

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/me/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

bwrap: Can't make symlink at /var/run: File exists

I keep getting the same result.

@TingPing

Anyway this can be closed, it will be fixed in the next release. Workaround above in the meantime.

Please reopen, because it apparently still is an issue.

@easbarba
Copy link

easbarba commented Jun 27, 2020

Just run in the issue.

flatpak run com.valvesoftware.Steam

bwrap: Can't make symlink at $HOME/Music

Debian SID 10
Kernel: 5.7.0-1-amd64
Exwm

@fallingcats
Copy link

Just run in the issue.

flatpak run com.valvesoftware.Steam

bwrap: Can't make symlink at $HOME/Music

Debian SID 10
Kernel: 5.7.0-1-amd64
Exwm

I just had this happen on fully updated Arch, also with steam.
Flatpak 1.10.0

@tinywrkb
Copy link

I also hit this with Steam, it sets persist=. permission which triggers this bug with a recent Flatpak 1.12.2.
persist=. is the ugliest Flatpak hack to support dotfiles directly under ~/.
I don't blame the Steam maintainer, this should be removed from Flatpak altogether.
No one should set persist=., instead maintainers should set filesystem=home.

@schildbach
Copy link

This issue is still present in Flatpak 1.6.5.

@aaronw2
Copy link

aaronw2 commented Jan 12, 2023

It's still happening in 1.12.5 on OpenSUSE with FreeCAD and I'm seeing it in Steam as well.

@smcv
Copy link
Collaborator

smcv commented Jan 12, 2023

Information for anyone who is getting the symptom "Can't make symlink at /var/run: File exists":

This is an error message that can happen for multiple reasons. It's shown by a low-level component (bubblewrap) which does not have enough context to be able to tell you the reason why this is happening.

The original reason for that error message in this specific issue is that XDG_RUNTIME_DIR was set to a path starting with /var/run, on a system where /var/run was a symlink to /run.

Any other reason for the same error message is outside the scope of this issue. #3477 is another example of the same error message happening for a different reason. If you are seeing the same error message for a different reason, please check for other issue reports that match, and if there is none, open a separate issue with full details (including flatpak run -vv output so that we can see what is going on).

Please do not reply to this closed issue.

A suggestion for the developers: put a mention of the XDG_RUNTIME_DIR variable into the error message!

No, that would be misleading. bubblewrap does not have enough information to know that the root cause for the bug involves XDG_RUNTIME_DIR.

The root cause involving XDG_RUNTIME_DIR was already fixed, the root cause involving /var/run/media is #3477 and has not been fixed, and there are probably other reasons why the same error message can appear.

@smcv smcv changed the title bwrap: Can't make symlink at /var/run: File exists "bwrap: Can't make symlink at /var/run: File exists" when XDG_RUNTIME_DIR starts with /var/run/ Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sandbox issue related to sandbox setup
Projects
None yet
Development

No branches or pull requests