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
"bwrap: can't make symlink at /var/run: File exists" when /media is a symlink to /var/run/media #3477
When I try to run to run any project in (distro's) Builder I do get after correctly building the app
Application started at 04:59:29 AM
bwrap: Can't make symlink at /var/run: File exists
Application exited
It happened through 3.34 branch and even on 3.32 but at the time it went away with
systemctl start --user xdg-desktop-portal
If I try to run flatpak'd Builder instead, I do get
➜ Projects flatpak --verbose run org.gnome.BuilderF: No installations directory in /etc/flatpak/installations.d. SkippingF: Opening system flatpak installation at path /var/lib/flatpakF: Opening user flatpak installation at path /home/user/.local/share/flatpakF: Opening user flatpak installation at path /home/user/.local/share/flatpakF: Opening system flatpak installation at path /var/lib/flatpakF: Opening user flatpak installation at path /home/user/.local/share/flatpakF: Opening system flatpak installation at path /var/lib/flatpakF: Cleaning up unused container id 2123384349F: Allocated instance id 2731448443F: Add values in dir '/org/gnome/builder/', prefix is '/org/gnome/Builder/'F: Add defaults in dir /org/gnome/Builder/F: Add locks in dir /org/gnome/Builder/F: writing D-Conf values to /home/user/.var/app/org.gnome.Builder/config/glib-2.0/settings/keyfileF: Allowing dri accessF: Allowing host-fs accessF: Allowing homedir accessF: Allowing wayland accessF: Allowing x11 accessF: Allowing session-dbus accessF: Allowing system-dbus accessF: Running 'bwrap --args 27 xdg-dbus-proxy --args=33'F: Running 'bwrap --args 30 gnome-builder'bwrap: Can't make symlink at /var/run: File exists
Steps to reproduce
Create a new GNOME application in GNOME Builder (any language)
Click on run
Maybe something is wrong in my /var. Do you know where should I look?
Even without GNOME Buidler, I've been running into the same issue since basically forever (preventing me from testing Flatpak on Ubuntu Live ISOs). E.g., 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
me@host:~$ ls -lh /var/run
lrwxrwxrwx 1 root root 4 Feb 3 19:22 /var/run -> /run
me@host:~$ mount | grep "on /run"
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/user/999 type tmpfs (rw,nosuid,nodev,relatime,size=1007308k,mode=700,uid=999,gid=999)
gvfsd-fuse on /run/user/999/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=999,group_id=999)
Also FYI for anyone following advice about messing with /var/run, don't it will cause your system to not boot because GDM needs NetworkManager and NetworkManager relies on that symlink.
@tallero Yeah, in hindsight I can see that what you said is correct, the issue is that I didn't know that it was "temporarily as in move it back or you soft brick your OS", I decided to let other people know by making it extra clear :) Also, while it does fix some apps like Gnome Builder not launching, it breaks NetworkManager, so working on apps like Gnome Web is impossible without directly solving this issue.
Running the org.gnome.Builder Flatpak app works fine for me (with Flatpak 1.10.2 on Debian 11).
Do you have any Flatpak permissions overrides, either for GNOME Builder or globally? I suspect this can be triggered by sharing more filesystems with the app. Try:
Also try running flatpak run -vv (-vv instead of --verbose) which would show the full bubblewrap command-line.
Also FYI for anyone following advice about messing with /var/run, don't
Certainly don't remove /var/run, it's a necessary part of the OS. On most Linux distributions the expected situation is that you have a symlink /var/run -> /run and a tmpfs on /run.
Running the org.gnome.Builder Flatpak app works fine for me (with Flatpak 1.10.2 on Debian 11).
Do you have any Flatpak permissions overrides, either for GNOME Builder or globally? I suspect this can be triggered by sharing more filesystems with the app. Try:
Also try running flatpak run -vv (-vv instead of --verbose) which would show the full bubblewrap command-line.
Also FYI for anyone following advice about messing with /var/run, don't
Certainly don't remove /var/run, it's a necessary part of the OS. On most Linux distributions the expected situation is that you have a symlink /var/run -> /run and a tmpfs on /run.
I don't know what Flatpak permission overrides are so I assume I don't have any...
Here is the output of each of the requested commands
I fixed it by binding the path /var instead of using a symlink
I would always recommend using mount points rather than symlinks for this sort of OS-level filesystem aliasing, where the existence of /.system is (presumably) an implementation detail and you still want /var to be treated as the canonical path.
I would always recommend using mount points rather than symlinks for this sort of OS-level filesystem aliasing, where the existence of /.system is (presumably) an implementation detail and you still want /var to be treated as the canonical path.
I overrode /var/run/docker.sock with a link to the host and now my flatpak won't start because it already exists and I can find no way of removing the override...
How in do I nuke the override? Flatseal couldn't reset, even uninstalling the flatpak doesn't reset it...
This is off-topic in this issue report, despite the similar error message, because this issue report is specifically about /media being a symlink to /var/run/media. I'm trying to keep to 1 issue = 1 report, to reduce confusion and avoid having issue reports that can never be closed because nobody knows whether all their root causes have been dealt with.
To remove filesystems=/var/run/docker.sock;/run/docker.sock; overrides, use:
flatpak override ... com.example.app will add or remove overrides in /var/lib/flatpak/overrides/com.example.app
flatpak override --user ... com.example.app will add or remove overrides in ~/.local/share/flatpak/overrides/com.example.app
flatpak override ... without an app ID will add or remove overrides in /var/lib/flatpak/overrides/global
flatpak override --user ... without an app ID will add or remove overrides in ~/.local/share/flatpak/overrides/global
For each of those four types of override, you can use flatpak override --show (with or without an app ID, and with or without --user) to show the overrides that exist.
Thank you, this helped me find the flatpak overrides were in /var/lib/flatpak/overrides, I ended up doing sudo rm /var/lib/flatpak/overrides/com.visualstudio.code to reset the package overrides (the --nofilesystem override explicitly excluded the files with ! prefix which inverts the override but doesn't remove it)
Is this meant to work with flatpak 1.14.10? I still can't start any flatpak app if it mounts a folder ~/GOG Games/ (as Minigalaxy does with its manifest) and that folder happens to be a symlink to somewhere else.
$ flatpak run io.github.sharkwouter.Minigalaxy
bwrap: Can't make symlink at /home/user/GOG Games: destination exists and is not a symlink
$ flatpak --version
Flatpak 1.14.10
bwrap: Can't make symlink at /home/user/GOG Games: destination exists and is not a symlink
You'll notice that this is not the same message as in the issue title.
You probably have a non-symlink (presumably a directory) in ~/.var/app/io.github.sharkwouter.Minigalaxy/GOG Games. bubblewrap cannot tell what you want to happen in this situation, so it defaults to "report an error and let the user sort it out".
The manifest for Minigalaxy has:
- --filesystem=~/GOG Games:create
- --persist=.
which means:
the "real" ~/GOG Games in my real home directory is required to be shared with the app
if it's a symlink, then Flatpak shares the symlink target with the app and creates the same symlink in the app's sandbox, to make this part of the sandbox's home directory as similar as possible to the corresponding part of the "real" filesystem
but also, I want everything in the sandbox's home directory to "persist", so the symlink/directory status of every file and directory in the sandbox's ~ will remain the same from one run to the next
This means that if the symlink/directory status of ~/GOG Games in your "real" home directory is not consistent with the symlink/directory status of ~/GOG Games in the sandbox's home directory ~/.var/app/io.github.sharkwouter.Minigalaxy, you will get an error.
The solution is to make ~/.var/app/io.github.sharkwouter.Minigalaxy/GOG Games consistent with ~/GOG Games, for example by removing an empty directory so that Flatpak can create a symlink in its place.
In principle it would be possible for Flatpak to detect that a path already exists in a --persist directory and therefore can only be created in a way that is consistent with what's already there; this could be reported as a separate feature request with steps to reproduce the issue, if you want. But the interactions between --persist and --filesystem are not simple, so it's relatively likely that it will only be resolved if someone from the community steps forward to figure out how it can be achieved and propose a PR.
Thanks so much for the response! I confirm that inner directory was present, and removing it fixed the problem. Some unqualified speculation of mine as to what happened: I don't think I created that directory, so the fix for this issue seems potentially somewhat ineffective if in practice something from flathub can create this inner directory, then result in later if a symlink is put in place by the user for it to not work. I'm guessing the problem is that I didn't do it before launching the app for the first time but at some later point, but that's not something the average user is going to be aware of. If that is correct, it would be nice if this could be addressed for the cases where the inner directory that the user didn't manually create is indeed completely empty.
Activity
probonopd commentedon Mar 22, 2020
Even without GNOME Buidler, I've been running into the same issue since basically forever (preventing me from testing Flatpak on Ubuntu Live ISOs). E.g., on the Xubuntu 18.04.2 LTS Live ISO:
tallero commentedon Mar 23, 2020
@probonopd Did you try with
systemctl --user start xdg-desktop-portal?probonopd commentedon Mar 24, 2020
Originally I hadn't, but even if I do, the result is the same. Thanks @tallero
tallero commentedon Mar 25, 2020
I am sorry. On 18.04's GNOME release that solved the bug for me at the time.
tallero commentedon Jun 5, 2020
Temporarly moving
/var/runsolves the problem, but isn't it created at boot?probonopd commentedon Jun 6, 2020
E.g., on Xubuntu Bionic Live ISO:
Yiannis128 commentedon Mar 17, 2021
Running into this issue as well...
Also FYI for anyone following advice about messing with
/var/run, don't it will cause your system to not boot because GDM needs NetworkManager and NetworkManager relies on that symlink.tallero commentedon Mar 17, 2021
@Yiannis128 wait I said temporarily
Yiannis128 commentedon Mar 17, 2021
@tallero Yeah, in hindsight I can see that what you said is correct, the issue is that I didn't know that it was "temporarily as in move it back or you soft brick your OS", I decided to let other people know by making it extra clear :) Also, while it does fix some apps like Gnome Builder not launching, it breaks NetworkManager, so working on apps like Gnome Web is impossible without directly solving this issue.
tallero commentedon Mar 18, 2021
Yes, I specified it because an year ago I've temporarily broken my system, too.
smcv commentedon Mar 18, 2021
Running the
org.gnome.BuilderFlatpak app works fine for me (with Flatpak 1.10.2 on Debian 11).Do you have any Flatpak permissions overrides, either for GNOME Builder or globally? I suspect this can be triggered by sharing more filesystems with the app. Try:
Also try running
flatpak run -vv(-vvinstead of--verbose) which would show the full bubblewrap command-line.Certainly don't remove
/var/run, it's a necessary part of the OS. On most Linux distributions the expected situation is that you have a symlink/var/run -> /runand a tmpfs on/run.smcv commentedon Mar 18, 2021
@Yiannis128, you haven't said what version of Flatpak you are using, or which operating system you are using?
Yiannis128 commentedon Mar 18, 2021
@smcv I'm using Manjaro running kernel 5.11.2-1-MANJARO. For Flatpak I have version 1.10.1 installed.
Yiannis128 commentedon Mar 18, 2021
I don't know what Flatpak permission overrides are so I assume I don't have any...
Here is the output of each of the requested commands
Here is the output of the -vv run command, it's big so I dumped it at TextBin:
https://textbin.net/rn8aclzcvb
smcv commentedon Mar 18, 2021
This is correct:
but then, later, this also appears in the command-line:
and I think that might be what is breaking it for you.
It looks as though your
/mediais a symbolic link to/var/run/media.If you change that to be a symbolic link to
/run/media, does that help?9 remaining items
mirkobrombin commentedon Jan 12, 2023
Thanks for the detailed answer. I fixed it by binding the path /var instead of using a symlink.
smcv commentedon Jan 12, 2023
#5213 might help with that, actually.
I would always recommend using mount points rather than symlinks for this sort of OS-level filesystem aliasing, where the existence of
/.systemis (presumably) an implementation detail and you still want/varto be treated as the canonical path.smcv commentedon Jan 12, 2023
@tallero: Was this symptom caused for you by the same setup that @Yiannis128 reported (
/mediaa symlink to/var/run/media)?If not, please provide the information I asked for in #3477 (comment), similar to #3477 (comment).
mirkobrombin commentedon Jan 12, 2023
I figured it out the hard way.
deftdawg commentedon Jan 18, 2023
I overrode
/var/run/docker.sockwith a link to the host and now my flatpak won't start because it already exists and I can find no way of removing the override...How in do I nuke the override? Flatseal couldn't reset, even uninstalling the flatpak doesn't reset it...
(this is with the flatpak no longer installed)
smcv commentedon Jan 18, 2023
This is off-topic in this issue report, despite the similar error message, because this issue report is specifically about
/mediabeing a symlink to/var/run/media. I'm trying to keep to 1 issue = 1 report, to reduce confusion and avoid having issue reports that can never be closed because nobody knows whether all their root causes have been dealt with.To remove
filesystems=/var/run/docker.sock;/run/docker.sock;overrides, use:The four possible sources of overrides are:
flatpak override ... com.example.appwill add or remove overrides in/var/lib/flatpak/overrides/com.example.appflatpak override --user ... com.example.appwill add or remove overrides in~/.local/share/flatpak/overrides/com.example.appflatpak override ...without an app ID will add or remove overrides in/var/lib/flatpak/overrides/globalflatpak override --user ...without an app ID will add or remove overrides in~/.local/share/flatpak/overrides/globalFor each of those four types of override, you can use
flatpak override --show(with or without an app ID, and with or without--user) to show the overrides that exist.deftdawg commentedon Jan 18, 2023
Thank you, this helped me find the flatpak overrides were in
/var/lib/flatpak/overrides, I ended up doingsudo rm /var/lib/flatpak/overrides/com.visualstudio.codeto reset the package overrides (the --nofilesystem override explicitly excluded the files with!prefix which inverts the override but doesn't remove it)Update submodule: bubblewrap 0.9.0
Update submodule: bubblewrap 0.9.0
Update submodule: bubblewrap 0.9.0
ell1e commentedon Sep 22, 2024
Is this meant to work with flatpak 1.14.10? I still can't start any flatpak app if it mounts a folder
~/GOG Games/(as Minigalaxy does with its manifest) and that folder happens to be a symlink to somewhere else.smcv commentedon Sep 23, 2024
You'll notice that this is not the same message as in the issue title.
You probably have a non-symlink (presumably a directory) in
~/.var/app/io.github.sharkwouter.Minigalaxy/GOG Games. bubblewrap cannot tell what you want to happen in this situation, so it defaults to "report an error and let the user sort it out".The manifest for Minigalaxy has:
which means:
~/GOG Gamesin my real home directory is required to be shared with the app~will remain the same from one run to the nextThis means that if the symlink/directory status of
~/GOG Gamesin your "real" home directory is not consistent with the symlink/directory status of~/GOG Gamesin the sandbox's home directory~/.var/app/io.github.sharkwouter.Minigalaxy, you will get an error.The solution is to make
~/.var/app/io.github.sharkwouter.Minigalaxy/GOG Gamesconsistent with~/GOG Games, for example by removing an empty directory so that Flatpak can create a symlink in its place.In principle it would be possible for Flatpak to detect that a path already exists in a
--persistdirectory and therefore can only be created in a way that is consistent with what's already there; this could be reported as a separate feature request with steps to reproduce the issue, if you want. But the interactions between--persistand--filesystemare not simple, so it's relatively likely that it will only be resolved if someone from the community steps forward to figure out how it can be achieved and propose a PR.ell1e commentedon Sep 23, 2024
Thanks so much for the response! I confirm that inner directory was present, and removing it fixed the problem. Some unqualified speculation of mine as to what happened: I don't think I created that directory, so the fix for this issue seems potentially somewhat ineffective if in practice something from flathub can create this inner directory, then result in later if a symlink is put in place by the user for it to not work. I'm guessing the problem is that I didn't do it before launching the app for the first time but at some later point, but that's not something the average user is going to be aware of. If that is correct, it would be nice if this could be addressed for the cases where the inner directory that the user didn't manually create is indeed completely empty.