Skip to content

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

Closed

Description

@KD0BPV

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

Activity

  1. alexlarsson commented on Oct 8, 2018

    @alexlarsson
    Member

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

  2. added
    sandbox
    on Oct 10, 2018
  3. KD0BPV commented on Oct 10, 2018

    @KD0BPV
    Author

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

  4. KD0BPV commented on Oct 10, 2018

    @KD0BPV
    Author

    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?

  5. YogSottot commented on Oct 28, 2018

    @YogSottot

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

    gentoo

  6. omichalek commented on Dec 1, 2018

    @omichalek

    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
    
  7. KD0BPV commented on Dec 21, 2018

    @KD0BPV
    Author

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

  8. sumdog commented on Jan 28, 2019

    @sumdog

    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?

  9. sumdog commented on Jan 28, 2019

    @sumdog

    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

  10. duckinator commented on Feb 1, 2019

    @duckinator

    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.

  11. ph1lt0r commented on Feb 1, 2019

    @ph1lt0r

    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.

  12. duckinator commented on Feb 26, 2019

    @duckinator

    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
    ~$
    
  13. omichalek commented on Feb 26, 2019

    @omichalek

    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!

  14. TingPing commented on Feb 26, 2019

    @TingPing
    Member

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

  15. probonopd commented on Sep 15, 2019

    @probonopd

    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
    
  16. probonopd commented on Sep 15, 2019

    @probonopd

    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
    
  17. probonopd commented on Sep 15, 2019

    @probonopd
  18. refi64 commented on Sep 15, 2019

    @refi64
    Collaborator

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

  19. probonopd commented on Sep 15, 2019

    @probonopd

    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.

  20. tallero commented on Jan 17, 2020

    @tallero

    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

  21. tallero commented on Mar 2, 2020

    @tallero

    This still happens on Archlinux as of today.

  22. probonopd commented on Mar 22, 2020

    @probonopd

    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.

  23. easbarba commented on Jun 27, 2020

    @easbarba

    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

  24. fallingcats commented on Feb 3, 2021

    @fallingcats

    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

  25. tinywrkb commented on Oct 26, 2021

    @tinywrkb

    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.

  26. schildbach commented on Apr 20, 2022

    @schildbach

    This issue is still present in Flatpak 1.6.5.

  27. aaronw2 commented on Jan 12, 2023

    @aaronw2

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

  28. smcv commented on Jan 12, 2023

    @smcv
    Collaborator

    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.

  29. 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/[/+] on Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions