Skip to content

bwrap: Can't make symlink at $HOME/Music: File exists #1971

Closed

Description

Archlinux

Flatpak 0.99.3

Description of the problem:

When i want to open steam (com.valvesoftware.Steam) via the command 'flatpak run com.valvesoftware.Steam'

Steam don't launch and this error appear: bwrap: Can't make symlink at /home/xwarzor/Musique: File exists

Steps to reproduce:

The problem appear since i have created a symbolic link from /home/xwarzor/Musique to a music folder in another disk. (via the command 'ln -s' )

Activity

  1. Solarinas commented on Aug 20, 2018

    @Solarinas

    Hey, I'm having the same problem on the same OS on the same version of flatpak. By removing the symlink Steam can work. If I create a folder called Music it has the error bwrap: Can't bind mount /oldroot/home/solarinas/Music on /newroot/home/solarinas/Music: No such file or directory

  2. TingPing commented on Aug 20, 2018

    @TingPing
    Member

    I realize this isn't the core of the problem but the correct way to set a music directory is xdg-user-dirs-update --set MUSIC /foo/bar not symlinking.

  3. PorcelainMouse commented on Dec 5, 2018

    @PorcelainMouse

    I don't understand why steam is messing with the the home directory or desktop environment things like Picutres, Music, Videos. It is nonstandard for applications to f with that stuff on Linux.

  4. Mange commented on Jan 1, 2019

    @Mange

    Is there some other workaround that don't involve making weird hacks to the current symlink setup?

    I tried switching from a symlink to a --bind mount, but then I get this error:

    bwrap: Can't bind mount /oldroot/home/mange/Media/Music on /newroot/home/mange/Media/Music: No such file or directory
    

    I'm mounting my NAS on /mnt/nas, and I'm using the music storage there in my standard Music path (set to /home/mange/Media/Music in my XDG dirs). I'd rather not have to build a big system for having custom XDG directories on all my machines, when I could use the same path for all of them. Right now I can keep the XDG dirs file in my dotfiles repo.

  5. TingPing commented on Jan 1, 2019

    @TingPing
    Member

    @Mange Exactly as I said: xdg-user-dirs-update --set MUSIC /mnt/nas/Music or whatever. You can then symlink the home dir there if you just wanted a shortcut from there.

  6. Mange commented on Jan 1, 2019

    @Mange

    But then I need to make the same change on all my machines as they share config files with each other.

  7. TingPing commented on Jan 2, 2019

    @TingPing
    Member

    If you want a non-standard xdg dir you have to run that command, thats just how it is.

  8. Mange commented on Jan 3, 2019

    @Mange

    If you want a non-standard xdg dir you have to run that command, thats just how it is.

    That's a very unhelpful reply. I am using a custom directory, on purpose, and that directory happens to be a symlink on one of my machines. There's nothing weird or non-standard with that.

    I've tried the following things to try to get rid of the buggy behavior:

    • Override the XDG_MUSIC_DIR env variable as the command is starting. (I had no expectation that this would work, however)
    • Attaching overrides that forbids access to the music directory.
    • Running with music explicitly forbidden.
    • Fixing the generated symlink (in ~/.var/…).
    • Explicitly allowing access to the symlink destination.
    • All of the above at the same time.

    Seems like #1658 is the one holding us back, with #1781 preventing us from doing any overrides.

    Technically it works if I wrap the command in a script that removes the symlink in .var before invoking flatpak, but then that wrapper won't be used by the .desktop files, etc.

    I decided that flatpak still isn't worth the hassle so I uninstalled it. I came in exited to try to help you guys find the source of a bug, but this sort of response soured me up quite a bit. I wish you luck with your future endeavors.

  9. da2x commented on May 17, 2019

    @da2x
    Contributor

    @Mange I believe you may have misunderstood @TingPing’s answer. You can keep the current symlinks in your home directory. You just also need to reconfigure XDG using the command he provided. Flatpak doesn’t actually care about the symlink in your home directory if it can find the direct destination from your XDG configuration.

  10. charlydelta commented on Oct 1, 2019

    @charlydelta

    I now have the same issue. I get the error message:

     ✘ user@machine  ~  flatpak run com.valvesoftware.Steam
    bwrap: Can't make symlink at /home/chris/media/images: File exists
    

    More info:

     ✘ user@machine  ~  cat .config/user-dirs.dirs 
    # This file is written by xdg-user-dirs-update
    # If you want to change or add directories, just edit the line you're
    # interested in. All local changes will be retained on the next run.
    # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
    # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
    # absolute path. No other format is supported.
    # 
    XDG_DESKTOP_DIR="$HOME/desktop"
    XDG_DOWNLOAD_DIR="$HOME/downloads"
    XDG_TEMPLATES_DIR="$HOME/templates"
    XDG_PUBLICSHARE_DIR="$HOME/public"
    XDG_DOCUMENTS_DIR="$HOME/documents"
    XDG_MUSIC_DIR="$HOME/media/music"
    XDG_PICTURES_DIR="$HOME/media/images"
    XDG_VIDEOS_DIR="$HOME/media/videos"
    

    So my XDG directories are properly set up.

  11. Mange commented on Oct 1, 2019

    @Mange

    @da2x No, I think you misunderstood my requirements. I do use a custom directory. I use the same custom directory on all my machines as I share XDG configuration files in my dotfiles repo.
    But on one machine, I mount my NAS directly instead of relying on file syncing. I solve that with symlinks, something which symlinks are really useful for.

    If I change the setting on that machine, my Git-tracked config file will be changed and all my machines would require access to my NAS. This is why I want the override in the filesystem, so my configs don't have to care where my music is stored. Maybe my SSD would be full on another machine, so I move the music storage over to a disk drive and set up a symlinks and I'm done. All apps that scans music directories will keep working. All "recently opened" entries stay the same, etc.

  12. Mange commented on Dec 6, 2019

    @Mange

    The command doesn't change your directories at all. It won't affect your simlinks. It doesn't even touch your setup. It just tells XDG-aware programs where to look for the actual folders that would normally be in the home folder (MUSIC, PICTURES, etc.).

    It tells those programs by changing the .config/user-dirs.dirs file. Which is the exact same file on all my machines since it's in my dotfiles. Which means that if I change it on Machine A to point to a disk connected only to Machine A, then Machine B and C and D will break. As it is the same file on all of them.

    It is much simpler to have a standard path on all my machines, and on the only machine with a special case (out of multiple machines) uses symlinks or mountpoints to get in line.

  13. refi64 commented on Dec 6, 2019

    @refi64
    Collaborator
  14. egeexyz commented on Nov 23, 2020

    @egeexyz

    It's been a couple years since this issue was created and it still seems to exist.

    For most applications, this will impact the MUSIC and PICTURES folders in ~. It's easy enough to work around though. For me it was:

    xdg-user-dirs-update --set MUSIC /mnt/71ba0404-2768-426f-a5d3-602c3557970c/Music
    xdg-user-dirs-update --set PICTURES /mnt/71ba0404-2768-426f-a5d3-602c3557970c/Pictures

    The location under /mnt is my external drive. If you want to work around this issue quickly, you could set these paths to tmp:

    xdg-user-dirs-update --set MUSIC /tmp
    xdg-user-dirs-update --set PICTURES /tmp

    Keep in mind that /tmp/ won't persist between reboots but its a quick & dirty way around this issue for now.

  15. 3 remaining items

  16. vlad196 commented on May 28, 2023

    @vlad196

    So far, problems with symlinks, if they exist. Why does flatpack steam need something from my home directory?

  17. ilyasturki commented on Jul 6, 2023

    @ilyasturki

    I have similar issue but with ~/.icons directory. I have filesystems=~/.icons/:ro; in my overrides, to make the cursor theme work in flatpak applications, I guess it has something to do with it.

    I have the same issue

  18. JohnTheCoolingFan commented on Dec 10, 2023

    @JohnTheCoolingFan

    I am using a shared root steam library across two linux installs, symlinked to ~/Games. I have the XDG_GAMES_DIR in user-dirs.dirs set to use the dir that is not behind a symlink, but it's not being set as an environment variable, which I have no idea whether would it affect anything. I also added ~/Games to allowed filesystems for steam to access using flatseal. I get the error bwrap: Can't make symlink at /home/jtcf/Games: File exists when trying to launch steam.

    It's irritating trying to find out where the issue is (whether it's flatpak or my system config) and I'm surprised it exists for 5 years already

  19. hideki2k02 commented on Jan 29, 2024

    @hideki2k02

    I'm getting a similar problem but its because i made a script to automatically generate a Discord Rich Presence Client symlink at /run/user/1000/discord-ipc-0

    bwrap: Can't make symlink at /run/user/1000/discord-ipc-0: File exists

    One thing that is interesting is that if its a hardlink Flatpak wont complain. Maybe a way to fix this is to just clear all symlinks once the program closes/Just ignore the symlink if "File exists"

  20. legluondunet commented on Jan 31, 2024

    @legluondunet

    I had the same issue:

    /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=heroic-run --file-forwarding com.heroicgameslauncher.hgl @@u %u @@
    bwrap: Can't make symlink at /home/legluondunet/Games: File exists
    

    I installed Flatseal and give to Heroic app authorization to access my home.
    I didn't find this solution myself, I didn't guess it, I read it on another forum.
    I am an IT professional, I work in IT support and I want to say that this message does not help anyone, it is not intuitive. It would have been more relevant to point out in this message that the Heroic application does not have access rights to my home directory.

  21. ChocolateLoverRaj commented on Jan 31, 2024

    @ChocolateLoverRaj

    I had this problem with Steam (Flatpak). I had symlinked ~/Música to ~/Music, ~/Documentos to ~/Documents, etc. I removed the symlinks, and that stopped the error.

  22. hideki2k02 commented on Jan 31, 2024

    @hideki2k02

    I had this problem with Steam (Flatpak). I had symlinked ~/Música to ~/Music, ~/Documentos to ~/Documents, etc. I removed the symlinks, and that stopped the error.

    If the issue is caused by a symlink you've created the only current "workaround" AFAIK is using hardlinks instead of symlinks.

  23. rosimelade commented on Feb 5, 2024

    @rosimelade

    I have this same problem. I want to keep some of the default xdg directories in another disk and i have symlink for them in my home directory. If i update xdg directories rather than symlink, with xdg update command, it brokes other applications such as Firefox. Even if I add other disk and directory path as permission with Flatseal, Firefox can't save files I downloaded. Tried to search Flatpak mount directories but the files aren't there either. If I only use symlink, which makes Firefox works without any problem, then Steam creates problem. I don't know how to keep them together.

  24. hfiguiere commented on Feb 11, 2024

    @hfiguiere
    Collaborator

    dupes of #2387

  25. AyoungDukie commented on Feb 11, 2024

    @AyoungDukie

    Perhaps this is my inexperience with this repo, but this issue was 3-4 months older than the one referenced. Additionally, this issue has had far more active engagement and productive discussion attempting to understand/debug the problem. It seems like #2387 is the duplicate to close, and this issue #1971 should be reopened?

  26. hfiguiere commented on Feb 11, 2024

    @hfiguiere
    Collaborator

    The order does't matter, you don't get a badge for filing it first. Nor for engagement. And github doesn't provide the tools to handle duplicate issues.

  27. AyoungDukie commented on Feb 11, 2024

    @AyoungDukie

    I apologize if I came across negatively, as I am not trying to create a problem.

    However, I am not seeking a badge (it isn't even my issue post). I am also not trying to base merit of an issue on its "engagement" alone.

    I am simply pointing out if it makes more sense for record-keeping to preserve the discussion with more debugging information and active attempts to solve the problem, as this info could help with resolving the issue in the future.

  28. Rotstein007 commented on Mar 27, 2026

    @Rotstein007

    Hi, I have the same issue here. System: Fedora 43, Gnome 49, bwrap 0.11.0, flatpak 1.16.3
    Log:
    user@fedora:~ $ ln -s Nextcloud/Bilder/ Bilder
    user@fedora:~ $ ln -s Nextcloud/Dokumente/ Dokumente
    user@fedora:~ $ steam
    bash: steam: Befehl nicht gefunden...
    user@fedora:~ $ flatpak run com.valvesoftware.Steam
    bwrap: Can't make symlink at /home/user/Bilder: destination exists and is not a symlink
    user@fedora:~ $

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions