Article View: linux.debian.bugs.dist
Article #6775Bug#1155833: flatpak: intermittent "invalid merge-dirs" error
From: tamila
Date: Sun, 29 Nov 2026 18:10
Date: Sun, 29 Nov 2026 18:10
106 lines
5464 bytes
5464 bytes
Package: flatpak
Version: 1.16.6-1~deb13u3
Severity: important
Tags: patch trixie
Dear Maintainer,
since the security backport for GHSA-w69g-9x8j-7p8f (1.16.6-1~deb13u2,
d/p/GHSA-w69g-9x8j-7p8f/run-Use-RESOLVE_BENEATH-for-host-side-extension-file-acce.patch)
`flatpak run` sometimes fails right at the start of a desktop session
with:
error: Extension org.freedesktop.Platform.GL.default has invalid
merge-dirs
The app is not started. Running the very same command again a bit later
works fine. Nothing in the installation changes between a failing and a
working run.
* System
- Debian 13 (trixie), aarch64 (Raspberry Pi 4), kernel
6.18.60+rpt-rpi-v8
- flatpak 1.16.6-1~deb13u3 (system installation)
- App: io.github.qtox.qTox 1.18.6, runtime org.kde.Platform 6.10
- Extension: org.freedesktop.Platform.GL.default, branches 25.08 and
25.08-extra
- XFCE session with LightDM autologin; the app is started from
~/.config/autostart/*.desktop with `Exec=flatpak run
io.github.qtox.qTox`
- The machine reboots daily at 04:00, so the app is autostarted once a
day
* Observed frequency
The autostart failed on 2 of the last 7 boots (2026-11-27 and
2026-11-29); on the other 5 boots the app started normally. On
2026-11-29 the error above is in ~/.xsession-errors; a manual start of
the same command later that day succeeded.
* Analysis
The message comes from the backported hunk in
flatpak_run_add_extension_args() (common/flatpak-run.c):
source_dfd = glnx_chaseat (files_dfd, ext->merge_dirs[i],
GLNX_CHASE_RESOLVE_BENEATH |
GLNX_CHASE_MUST_BE_DIRECTORY, NULL);
if (source_dfd < 0)
{
if (errno == ENOENT || errno == ENOTDIR)
continue;
return flatpak_fail_error (error, FLATPAK_ERROR,
"Extension %s has invalid
merge-dirs", ...);
}
glnx_chaseat() in the bundled subprojects/libglnx/glnx-chase.c calls
openat2() with RESOLVE_BENEATH and treats every error except
ENOSYS/EPERM as fatal. openat2(2) documents that with RESOLVE_BENEATH
it may return EAGAIN if a rename or mount happened concurrently while
a
".." component was being resolved, and that the caller may retry.
The GL extension does contain such ".." symlinks inside merge-dirs,
e.g. in both branches:
vulkan/icd.d -> ../lib/vulkan/icd.d
vulkan/explicit_layer.d -> ../share/vulkan/explicit_layer.d
vulkan/implicit_layer.d -> ../share/vulkan/implicit_layer.d
At session start several mounts happen at the same time (for example
the document portal FUSE mount /run/user/1000/doc is set up by
xdg-document-portal, which is activated by this very `flatpak run`),
so a spurious EAGAIN is plausible. I could not capture the actual
errno
(flatpak does not log it), but EAGAIN is the only error in this code
path that is transient; all other ones would make every start fail.
* Upstream fix
libglnx already fixed this:
commit eef7f14c344723cb20bebd04dcc79be77363c3be
"chase: Handle EAGAIN from openat2" (2026-08-18)
https://gitlab.gnome.org/GNOME/libglnx/-/commit/eef7f14c344723cb20bebd04dcc79be77363c3be
It simply retries openat2() while it returns EAGAIN. This commit is
not in 1.16.6-1~deb13u3, and judging by debian/patches/series it is
not in 1.16.6-1~deb13u4 either.
* Request
Please consider adding this libglnx commit to the next trixie update
of flatpak, next to the already backported
d/p/libglnx/chase-*.patch.
* Workaround
Delaying the autostart and retrying once, e.g.
Exec=sh -c "sleep 15; flatpak run io.github.qtox.qTox || { sleep
30; flatpak run io.github.qtox.qTox; }"
Thank you!
Technical Details
Message-ID:
<O4Rvz-eVXu-23@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: tamila@extmail.info Newsgroups: linux.debian.bugs.dist Subject: Bug#1155833: flatpak: intermittent "invalid merge-dirs" error Date: Sun, 29 Nov 2026 19:10:01 +0100 Message-ID: <O4Rvz-eVXu-23@gated-at.bofh.it> X-Original-To: submit@bugs.debian.org X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sun Nov 29 18:02:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.451 Reply-To: tamila@extmail.info, 1155833@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: pkg-utopia-maintainers@lists.alioth.debian.org X-Debian-Pr-Message: report 1155833 X-Debian-Pr-Package: flatpak X-Debian-Pr-Keywords: patch trixie X-Debian-Pr-Source: flatpak MIME-Version: 1.0 User-Agent: Roundcube Webmail X-Sender: tamila@extmail.info Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2005946 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 106 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 29 Nov 2026 18:00:50 +0000 X-Original-Message-ID: <c4617a551e74cece15f1cc5d10249d3d@extmail.info>