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
[Bug]: bwrap: Can't make symlink at /var/run: File exists, involving /var/run/media #5255
Comments
As I tried to indicate on [edit: #2710], we are not going to be able to magically solve this without more information, so please provide the output of There are a lot of possible root causes for this error message, because it's coming from a low-level component that just doesn't have the necessary information to provide more context. #2200 was fixed by #2710; #3477 is the same error message for a different reason; and this one might be the same as #3477, or something different. We can't know without more details.
I think you mean #2200. #2000 looks like something unrelated. |
If I change line 1466 in bubblewrap.c to fprintf(stderr, ...) it works. |
You're replacing Please attach the Flatpak verbose log so that we can see what is breaking this. |
I agree it's a workaround, but I've been hitting this bug for quite some time and need a quick way to continue. |
|
This also fixed SteamVR for me as well. |
I think this is another report of the same root cause as #3477. Key factors:
Flatpak tries to preserve the symlink structure of the host system to the best of its ability, which includes creating a symlink Workaround: remove the I'm closing this as a duplicate of #3477 since it seems to be a good match for what happened there. |
Please try reverting your workaround in bubblewrap, and doing this instead. |
I hit the same problem. /media now points to /run/media instead of /var/run/media. |
Do you mean you still get "Can't make symlink at /var/run: File exists", even with It would also be useful to know whether the app has any overrides, similar to #3477 (comment). Flatpak 1.12.5 is an old version. If you're able to run 1.14.x or even 1.15.x (either at OS level or compiled from source), that has considerably better diagnostic messages for exports/filesystem handling - older versions only tell us what they are doing, but from 1.14.0 onwards it also tells us why. |
fp.log This is the wrong behavior since it has already detected that /var/run is a symbolic link. If the link exists, it should not create a new one. It also does not matter if /var/run is a link to /run or to ../run. I suspect that it will also fail when it tries to create the /media symbolic link since it also already exists. It might also make sense to use the realpath function to resolve these to absolute paths. |
Thanks, that log clarifies what is happening. However, it still looks like #3477. You said "/media now points to /run/media instead of /var/run/media" which would be the workaround for #3477; but in your latest log, Flatpak still says If you replace If yes, then this issue is the same as #3477 (which brings us one step closer to solving it, because we already know how to reproduce #3477 and why it's a problem). If no, then please share a log using a recent Flatpak, but with the workaround in place, so that you are not experiencing #3477, and we can investigate the new problem that is (so far) unique to you.
If we were creating symlinks on the host system, you'd be right, but that's not what Flatpak is doing: it's creating symlinks inside the Flatpak sandbox, which mirror the structure of the relevant directories on the host system. The Flatpak sandbox starts as an empty tmpfs, then we mount the Flatpak runtime onto The problem in #3477 is that
Flatpak does use If we didn't do that, then we would get weird bugs when a configuration file or other state refers to the same directory by multiple paths that are equivalent on the host system but not equivalent inside the container. For instance, if you have an external disk mounted on
Similarly, this is not trying to overwrite |
I'm out of town until next week. I recall testing both cases of /media with
the same result. I will double check next week.
…-Aaron
On Thu, Jan 12, 2023, 6:03 AM Simon McVittie ***@***.***> wrote:
As I tried to indicate on #2200
<#2200>, we are not going to be
able to magically solve this without more information, so please provide
the output of flatpak run -v -v org.freecadweb.FreeCAD.
There are a lot of possible root causes for this error message, because
it's coming from a low-level component that just doesn't have the necessary
information to provide more context. #2200
<#2200> was fixed by #2710
<#2710>; #3477
<#3477> is the same error
message for a different reason; and this one might be the same as #3477
<#3477>, or something different.
We can't know without more details.
This was closed in issue #2000
<#2000>
I think you mean #2200 <#2200>.
#2000 <#2000> looks like
something unrelated.
—
Reply to this email directly, view it on GitHub
<#5255 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJUAEYX3G43XI7OBV3PXDDWSAFK3ANCNFSM6AAAAAATZHZS3I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It looks like changing the /media symlink fixes the issue. It is now working. |
I am still seeing this error with Steam flatpak games. |
That implies that at least this part of your issue report was a duplicate of #3477, which is already tracked.
Even with Some of the details that will be relevant:
|
Not OP here, but I can provide a sample of Steam failing to run when symlinks are involved. This is with Flapak 1.14.4. The user was created specifically to demonstrate this fault. Beginning with an essentially empty home directory and no user-specific environment variables, I created
It seems like |
That's containers/bubblewrap#549, pull requests welcome (I'm unlikely to have time to implement it any time soon). It's in quite low-level code, but shouldn't be particularly difficult to implement. |
Pull request submitted. I was able to run Steam in exact same scenario as before without issues. |
This helped me for Steam installed via flatpak on Fedora Silverblue. My use case was that I also allowed additional filesystem paths (that are mounted on separate drive under /run/media/) for games and mesa cache |
* `--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 <smcv@collabora.com>
* `--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 <smcv@collabora.com>
Checklist
Flatpak version
1.12.5
What Linux distribution are you using?
openSUSE
Linux distribution version
15.4
What architecture are you using?
x86_64
How to reproduce
Expected Behavior
I expect it to work.
Actual Behavior
bwrap: Can't make symlink at /var/run: File exists
I see this with numerous other flatpaks as well, such as SteamVR.
Additional Information
This was closed in issue #2000, but it clearly is not fixed and is still an issue.
echo $XDG_RUNTIME_DIR
/run/user/500
export XDG_RUNTIME_DIR=/var/run/user/500
Same error.
Note that /var/run is a symlink to /run on OpenSUSE.
The text was updated successfully, but these errors were encountered: