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 /media is a symlink to /var/run/media #3477
Comments
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:
|
@probonopd Did you try with |
Originally I hadn't, but even if I do, the result is the same. Thanks @tallero |
I am sorry. On 18.04's GNOME release that solved the bug for me at the time. |
Temporarly moving |
E.g., on Xubuntu Bionic Live ISO:
|
Running into this issue as well... Also FYI for anyone following advice about messing with |
@Yiannis128 wait I said temporarily |
@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. |
Yes, I specified it because an year ago I've temporarily broken my system, too. |
Running the 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
Certainly don't remove |
@Yiannis128, you haven't said what version of Flatpak you are using, or which operating system you are using? |
@smcv I'm using Manjaro running kernel 5.11.2-1-MANJARO. For Flatpak I have version 1.10.1 installed. |
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: |
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 If you change that to be a symbolic link to |
OK, I can reproduce this by changing my Replacing |
The thing is that wasn't a directory in my original Manjaro install, I created it because I wanted an easy way to access /run/media since I was used to /media before using Systemd. I'll remap /media to /run/media.... |
Thanks this fixed it. But can you explain why this was an issue in the first place? I want to understand the reason this happened. |
Not easily, and I'd prefer to spend that time writing a merge request to fix this for everyone permanently. If you want to, you have access to the complete source code and can trace through exactly what Flatpak does, though :-) |
Understandable, thanks for the help regardless. |
I'm facing the same issue in a setup where /var is a symlink of /.system/var. What exactly is going on under the hood that makes Flatpak/bwrap so sensitive to symlinks? |
Please report that separately, with The symptom is the same, but the root cause is different (similar to the relationship between #2200 and this issue). |
The short version? "Containers". Flatpak uses Linux bind-mounts to set up its sandbox environment, but there are several factors that make bind-mounts and symlinks conflict. The most obvious one is that the sandbox environment is a different mount namespace, so if we set up a symlink inside the sandbox environment pointing to something that isn't available in the sandbox, it won't work. We have to figure out what the symlink points to on the host, bind-mount that into the sandbox instead, and then replicate the symlink structure that points to it. This is made harder by the fact that the Linux kernel doesn't let us bind-mount a symlink into the sandbox, or mount on top of a symlink: it will always follow the symlink and act on its target instead (it's like It's also made harder by the fact that some parts of the filesystem are special to the Flatpak runtime, notably |
Thanks for the detailed answer. I fixed it by binding the path /var instead of using a symlink. |
#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 |
@tallero: Was this symptom caused for you by the same setup that @Yiannis128 reported ( If not, please provide the information I asked for in #3477 (comment), similar to #3477 (comment). |
I figured it out the hard way. |
I overrode How in do I nuke the override? Flatseal couldn't reset, even uninstalling the flatpak doesn't reset it... flatpak override --show com.visualstudio.code
(this is with the flatpak no longer installed) |
This is off-topic in this issue report, despite the similar error message, because this issue report is specifically about To remove
The four possible sources of overrides are:
For each of those four types of override, you can use |
Thank you, this helped me find the flatpak overrides were in |
* `--symlink` is now idempotent, meaning it succeeds if the symlink already exists and already has the desired target (containers/bubblewrap#549, flatpak#2387, flatpak#3477, flatpak#5255) * Report a better error message if `mount(2)` fails with `ENOSPC` (containers/bubblewrap#615, ValveSoftware/steam-runtime#637) * Fix a double-close on error reading from `--args`, `--seccomp` or `--add-seccomp-fd` argument (containers/bubblewrap#558) * Improve memory allocation behaviour (containers/bubblewrap#556, containers/bubblewrap#624) * Silence various compiler warnings (containers/bubblewrap#559) Resolves: flatpak#2387 Resolves: flatpak#3477 Resolves: flatpak#5255 Signed-off-by: Simon McVittie <[email protected]>
* `--symlink` is now idempotent, meaning it succeeds if the symlink already exists and already has the desired target (containers/bubblewrap#549, flatpak#2387, flatpak#3477, flatpak#5255) * Report a better error message if `mount(2)` fails with `ENOSPC` (containers/bubblewrap#615, ValveSoftware/steam-runtime#637) * Fix a double-close on error reading from `--args`, `--seccomp` or `--add-seccomp-fd` argument (containers/bubblewrap#558) * Improve memory allocation behaviour (containers/bubblewrap#556, containers/bubblewrap#624) * Silence various compiler warnings (containers/bubblewrap#559) Resolves: flatpak#2387 Resolves: flatpak#3477 Resolves: flatpak#5255 Signed-off-by: Simon McVittie <[email protected]>
Linux distribution and version
Archlinux, Builder v3.36.0, 3.34, 3.32
Flatpak version
1.6.2
Description of the problem
When I try to run to run any project in (distro's) Builder I do get after correctly building the app
It happened through 3.34 branch and even on 3.32 but at the time it went away with
If I try to run flatpak'd Builder instead, I do get
Steps to reproduce
Maybe something is wrong in my
/var
. Do you know where should I look?References
The text was updated successfully, but these errors were encountered: