You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flatpak gets confused where symlinks will end up #1658
@alexlarsson isn't the end goal here that the persist wouldn't affect things defined through filesystem since you can define things read-only through filesystem? Or did I still not get the full picture?
The fact that it works on first boot and then fails to work hints that the problem might be this:
bwrap checks if the file exists (which it doesn't as the symlink is broken) and then tries to create the symlink there which doesn't work as the file actually exists.
Maybe if the "file exists" check used lstat instead of stat-like functions, then it would work?
(This is just a guess, but I've been bitten by this exact problem in my own software a few times.)
[EDIT]: I've managed to disprove my hypothesis, because I managed to fix the symlink so it worked on my system but the problem persists.
Also hitting this. I reinstalled my system and replaced a few folders in ~ with symlinks to another storage device. I need to share one of those folders with the Steam flatpak, and now I can't properly do that because flatpak copies over the symlink to ~/.var/app/com.valvesoftware.Steam and then fails to clean it up after exiting.
A general workaround for most weird issues with symlinks is to prefer to use bind-mounts instead of symlinks.
Apps that aren't Steam often don't have this problem. Steam is special because any Steam game might try to write to any location, so the Steam Flatpak app uses --persist=. to make all of ~/.var/app/com.valvesoftware.Steam available as a persistent directory in the sandbox.
It's entirely possible that different people who are reporting this are seeing different root causes, and I suspect that a solution to any of them will require changes to bubblewrap - something along the lines of "don't treat failure to create a symlink as fatal if it already points to the same place we want it to".
The output from flatpak run -vv com.valvesoftware.Steam would probably be helpful to debug this.
I am still experiencing this issue with Linux Mint 20.3, Steam flatpak.
4 of my user directories are symlink to my NAS which is mounted with fstab using nfs protocol.
I am still working on a good workaround, because changing the XDG dirs seems to cause me a lot of problems with the NAS mounting correctly.
Output requested by @smcv output-flatpak-Steam.txt
I have global overrides where ~/.nix-profile is added which is a symlink of /nix/store/3w25fy7fpsb2s0q46qcf799x9y5d82zv-user-environment which changes every time nixos-rebuild switch. I disabled the override in Flatseal and Steam still wants to symlink ~/.nix-profile. Is there any solution?
$ flatpak run com.valvesoftware.Steambwrap: Can't make symlink at /home/ryan/media: File exists
$
Details
F: Trying to replace with tmpfs: /home/ryan/media/audio
F: /home/ryan/media is a symlink, resolved to /media
F: Trying to export the target instead: /media/audio
F: Trying to replace with tmpfs: /media/audio
F: /media is not a symlink
F: /media/audio is not a symlink
F: Will replace with tmpfs: /media/audio
F: Will create symbolic link: /home/ryan/media
F: "/home/ryan/media" is meant to be a symlink
F: Resolved "/home/ryan/media" to "/media" in host
F: Creating "/home/ryan/media" -> "../../media" in sandbox
F: "/media/audio" is meant to be a tmpfs or empty directory
F: Parent of "/media/audio" is not mapped, creating empty directory
:F: /media
:F: /media
:F: ../../media
:F: /home/ryan/media
:F: /media/audio
:F: /home/ryan/media/incoming
9:bwrap: Can't make symlink at /home/ryan/media: File exists
"Don't have symlinks" is not a useful answer. Flatpak is supposed to be isolated from my home directory. Why is this package trying to mess with creating symlinks here at all?
Because that is the only way Steam Cloud can work inside the app for all games including ones that support xdg spec and ones that don't without crashes.
Any progress on this? I'm getting hit by a variation of this as well trying to run flatpaks, as I have symlinks to redirect my XDG directories per-machine (to avoid them overwriting each others data):
bwrap: Can't make symlink at /run/user/4051/confredir/local: File exists
Can we close this now or do you want to keep it open until a bubblewrap release?
I think it would make most sense to keep this open until we have a bubblewrap release, and then update Flatpak's bundled bubblewrap to that version and close this issue (and the others) at that time.
Reacted by chrisawi, Seppo Yli-Olli and Ryan Delaney
Activity
nanonyme commentedon Aug 9, 2018
Out of curiosity, what would the end result here be if you ignored the error from bwrap?
nanonyme commentedon Aug 15, 2018
@alexlarsson isn't the end goal here that the persist wouldn't affect things defined through filesystem since you can define things read-only through filesystem? Or did I still not get the full picture?
Mange commentedon Jan 3, 2019
The fact that it works on first boot and then fails to work hints that the problem might be this:
bwrapchecks if the file exists (which it doesn't as the symlink is broken) and then tries to create the symlink there which doesn't work as the file actually exists.Maybe if the "file exists" check used
lstatinstead ofstat-like functions, then it would work?(This is just a guess, but I've been bitten by this exact problem in my own software a few times.)
[EDIT]: I've managed to disprove my hypothesis, because I managed to fix the symlink so it worked on my system but the problem persists.
dustymabe commentedon Oct 20, 2020
I hit this issue when running steam and stumbled across the entry in the FAQ that pointed me here.
I was using a per-user installation of flatpak and was able to workaround by doing something like:
You can make a wrapper in
/usr/local/bin/steamif you want so you don't have to do it every time:If you are using the system installation I assume the same would work by setting the
FLATPAK_SYSTEM_DIRvar.WhyNotHugo commentedon Dec 3, 2020
I'm getting this error too (and was also pointed here by the FAQ).
However, I can't make heads or tails of the errors:
However, steam does not have access to my
$HOME, nor$HOME/.config. Actually, it has access to no filesystem directories.Any hints on what's up?
YaLTeR commentedon Mar 31, 2021
Also hitting this. I reinstalled my system and replaced a few folders in
~with symlinks to another storage device. I need to share one of those folders with the Steam flatpak, and now I can't properly do that because flatpak copies over the symlink to~/.var/app/com.valvesoftware.Steamand then fails to clean it up after exiting.smcv commentedon Mar 31, 2021
A general workaround for most weird issues with symlinks is to prefer to use bind-mounts instead of symlinks.
Apps that aren't Steam often don't have this problem. Steam is special because any Steam game might try to write to any location, so the Steam Flatpak app uses
--persist=.to make all of~/.var/app/com.valvesoftware.Steamavailable as a persistent directory in the sandbox.It's entirely possible that different people who are reporting this are seeing different root causes, and I suspect that a solution to any of them will require changes to bubblewrap - something along the lines of "don't treat failure to create a symlink as fatal if it already points to the same place we want it to".
The output from
flatpak run -vv com.valvesoftware.Steamwould probably be helpful to debug this.gregzme17 commentedon May 29, 2022
I am still experiencing this issue with Linux Mint 20.3, Steam flatpak.
4 of my user directories are symlink to my NAS which is mounted with fstab using nfs protocol.
I am still working on a good workaround, because changing the XDG dirs seems to cause me a lot of problems with the NAS mounting correctly.
Output requested by @smcv
output-flatpak-Steam.txt
RossComputerGuy commentedon Oct 24, 2022
I have global overrides where
~/.nix-profileis added which is a symlink of/nix/store/3w25fy7fpsb2s0q46qcf799x9y5d82zv-user-environmentwhich changes every timenixos-rebuild switch. I disabled the override in Flatseal and Steam still wants to symlink~/.nix-profile. Is there any solution?rpdelaney commentedon Jul 4, 2023
I'm also affected:
Details
"Don't have symlinks" is not a useful answer. Flatpak is supposed to be isolated from my home directory. Why is this package trying to mess with creating symlinks here at all?
nanonyme commentedon Jul 4, 2023
Because that is the only way Steam Cloud can work inside the app for all games including ones that support xdg spec and ones that don't without crashes.
nanonyme commentedon Jul 4, 2023
It does not create symlinks inside your home but under a virtual home.
rpdelaney commentedon Jul 4, 2023
This sounds like a good solution.
CendioOssman commentedon Dec 15, 2023
Any progress on this? I'm getting hit by a variation of this as well trying to run flatpaks, as I have symlinks to redirect my XDG directories per-machine (to avoid them overwriting each others data):
toupeira commentedon Feb 17, 2024
Looks like this was now fixed in
bwrapand should make it into the next release: containers/bubblewrap#577chrisawi commentedon Mar 19, 2024
@smcv Can we close this now or do you want to keep it open until a bubblewrap release?
The same goes for the other issues you listed in containers/bubblewrap#549 (comment) (after verifying that they're fixed).
smcv commentedon Mar 19, 2024
I think it would make most sense to keep this open until we have a bubblewrap release, and then update Flatpak's bundled bubblewrap to that version and close this issue (and the others) at that time.
chrisawi commentedon Mar 27, 2024
Fixed in bubblewrap 0.9.0