Skip to content

[Bug]: Flatpak applications do not run if a systemd automount failed to mount #5112

Closed

Description

@bellegarde-c

Checklist

Flatpak version

1.14.0

What Linux distribution are you using?

Fedora Silverblue

Linux distribution version

37

What architecture are you using?

x86_64

How to reproduce

  1. Add a systemd automount in fstab
//172.21.0.208/Partage  /mnt/srv-data-3     cifs    x-systemd.automount,x-systemd.idle-timeout=60,_netdev,credentials=/var/home/gnumdk/.local/share/mount/smbcredentials,uid=1000,gid=1000,x-gvfs-hide 0 0

Expected Behavior

Flatpak applications run even if automount host not available

Actual Behavior

sept. 22 20:42:08 xps13 kernel: CIFS: Attempting to mount \\172.21.0.208\Partage
sept. 22 20:42:08 xps13 systemd[1]: Mounting var-mnt-srv\x2ddata\x2d3.mount - /var/mnt/srv-data-3...
sept. 22 20:42:08 xps13 systemd[1404]: dbus-:[email protected]: Failed with result 'exit-code'.
sept. 22 20:42:08 xps13 systemd[1404]: dbus-:[email protected]: Main process exited, code=exited, status=1/FAILURE
sept. 22 20:42:08 xps13 systemd[1]: var-mnt-srv\x2ddata\x2d3.automount: Got automount request for /var/mnt/srv-data-3, triggered by 2732 (gvfsd-r>
sept. 22 20:42:08 xps13 flatpak[12081]: error: Failed to sync with dbus proxy
sept. 22 20:42:08 xps13 flatpak[12089]: bwrap: Can't bind mount /oldroot/var on /newroot/var: Unable to remount recursively with correct flags: N>
sept. 22 20:42:08 xps13 systemd[1]: Failed to mount var-mnt-srv\x2ddata\x2d3.mount - /var/mnt/srv-data-3.
sept. 22 20:42:08 xps13 systemd[1]: var-mnt-srv\x2ddata\x2d3.mount: Failed with result 'exit-code'.
sept. 22 20:42:08 xps13 systemd[1]: var-mnt-srv\x2ddata\x2d3.mount: Mount process exited, code=exited, status=32/n/a
sept. 22 20:42:08 xps13 kernel: CIFS: VFS: cifs_mount failed w/return code = -115
sept. 22 20:42:08 xps13 kernel: CIFS: VFS: Error connecting to socket. Aborting operation.
sept. 22 20:42:08 xps13 mount[12067]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
sept. 22 20:42:08 xps13 mount[12067]: mount error(115): Operation now in progress

Additional Information

At work, all is working as expected: server is available.

At home, no more flatpak apps run.

F36 is pinned in Silverblue, rebooting to F36 and all is working as expected. So it's a regression.

Activity

  1. changed the title [-][Bug]: [/-] [+][Bug]: Flatpak applications do not run if a systemd automount failed to mount[/+] on Sep 22, 2022
  2. Ige-fi commented on Jan 7, 2024

    @Ige-fi

    I'm experiencing the same issue on Fedora Workstation 38 with my Flatpak apps. The Flatpak version is 1.15.4. It’s weird that this is blocking the applications from starting even though they have nothing to do with the automount filesystem. I'm using an automount setup precisely because my home server's NFS share is in no way mandatory for my desktop PC to function.

    Non-Flatpak apps like Nautilus launch just fine even if the automount filesystem can't be mounted.

  3. evanc577 commented on Jan 28, 2024

    @evanc577

    Also saw this today with an sshfs automount, all flatpak apps failed to start until the network share became available.

    Arch Linux
    Flatpak 1.15.6
    systemd 255 (255.2-2-arch)

    bwrap: Can't bind mount /oldroot/mnt on /newroot/mnt: Unable to apply mount flags: remount "/newroot
    /mnt/kangaroo": No such device
    error: Failed to sync with dbus proxy
    
    # /etc/systemd/system/mnt-kangaroo.mount
    [Unit]
    After=network-online.target
    Description=Mount kangaroo SSHFS share at boot
    
    [Mount]
    Type=fuse.sshfs
    What=redacted
    Where=/mnt/kangaroo
    Options=reconnect,IdentityFile=redacted,Port=10677,uid=1000,gid=1000,allow_other,noatime
    TimeoutSec=30
     
    [Install]
    WantedBy=multi-user.target
    
    # /etc/systemd/system/mnt-kangaroo.automount
    [Unit]
    Description=Automount kangaroo network drive
    
    [Automount]
    Where=/mnt/kangaroo
    
    [Install]
    WantedBy=multi-user.target
    
  4. eblanshey commented on Sep 8, 2024

    @eblanshey

    I just had an issue where no flatpaks could start/run due to an inaccessible NFS mount. What's the relation to running flatpaks?

    $ flatpak run org.videolan.VLC
    bwrap: Can't bind mount /oldroot/mnt on /newroot/mnt: Unable to apply mount flags: remount "/newroot/mnt/nas-shared": No such device
    error: Failed to sync with dbus proxy
    
  5. smcv commented on Sep 9, 2024

    @smcv
    Collaborator

    What's the relation to running flatpaks?

    Flatpak doesn't know which top-level directories your OS relies on to be able to run arbitrary host executables like xdg-dbus-proxy: normally the answer is just /bin, /lib* and /usr, but some OSs use different top-level directories like /opt, /nix and /gnu, and in principle you might have compiled your own xdg-dbus-proxy that was linked to libraries in /mnt/extra-libraries/lib. So when Flatpak is setting up a host-system-like namespace to run xdg-dbus-proxy, it has to make the pessimistic assumption that every top-level directory is functionally necessary.

  6. crepererum commented on Sep 9, 2024

    @crepererum

    I think this issue is not only about top-level directories. The original post mentions /mnt/srv-data-3 and I've experienced similar issues with network mounts under /mnt.

  7. smcv commented on Sep 9, 2024

    @smcv
    Collaborator

    Each top-level directory gets remounted recursively, so any failure to access a mount point below the top-level is fatal.

    This is not strictly necessary for the xdg-dbus-proxy use-case, because the namespace we're creating for xdg-dbus-proxy is only for identification and not a security boundary, unlike the namespace we create for the actual application - but bubblewrap doesn't know that (and there is currently no mechanism by which that information can be communicated to it), so it must pessimistically assume that a failure to set mount flags on any mount point would be a security vulnerability (undermining the intended security boundary of the sandbox), and must therefore "fail closed".

  8. crepererum commented on Sep 9, 2024

    @crepererum

    Could the mount point forwarding maybe not force-mount automount points, i.e. leave them as automount?

  9. smcv commented on Sep 9, 2024

    @smcv
    Collaborator

    Could the mount point forwarding maybe not force-mount automount points, i.e. leave them as automount?

    Not really: bubblewrap is not in a position to prove that this would not cause a security vulnerability. It needs to remount all mount points to apply MS_NODEV (if not using --dev-bind), MS_NOSUID (always), and MS_RDONLY (if using --ro-bind), and it is not possible to change the flags on an automount point without accessing and mounting it.

    Something like containers/bubblewrap#653 could potentially mitigate this, by giving Flatpak a way to tell bubblewrap "actually, this isn't a security boundary, so just do your best" when it runs xdg-dbus-proxy.

  10. eblanshey commented on Sep 11, 2024

    @eblanshey

    Thank you for trying to address this. It took a lot of frustration to determine why the majority of my applications weren't starting. I can't imagine a non-techie person figuring out via a cli command that no apps would open due to a mount that was set up in the /mnt directory, so I'm glad the issue is getting addressed.

  11. smcv commented on Sep 11, 2024

    @smcv
    Collaborator

    I can't imagine a non-techie person figuring out via a cli command that no apps would open due to a mount that was set up in the /mnt directory

    To be fair, I can't imagine a non-techie person setting up an NFS automount in the first place...

  12. crepererum commented on Sep 11, 2024

    @crepererum

    I can't imagine a non-techie person figuring out via a cli command that no apps would open due to a mount that was set up in the /mnt directory

    To be fair, I can't imagine a non-techie person setting up an NFS automount in the first place...

    I agree with the "NFS is for techies", but I think it's the UX implication that is weird and hence impactful: you set the automount up, start your Flatpak Apps via UI interaction (e.g. Gnome app launcher), go on a trip and then none of your apps start. To dig out THAT connection (esp. when your browser no longer starts as well) is not that trivial, esp. if you don't know the Flatpak/bubblewrap design.

  13. eblanshey commented on Sep 12, 2024

    @eblanshey

    I can't imagine a non-techie person figuring out via a cli command that no apps would open due to a mount that was set up in the /mnt directory

    To be fair, I can't imagine a non-techie person setting up an NFS automount in the first place...

    I set up Linux machines and recommend them to other non-techie people, as well. Dreaming to get as close to "Linux is just as good as Windows/Mac" scenario as I can!

    go on a trip and then none of your apps start

    @crepererum that is literally what happened to me :D

  14. Leonito2003 commented on Jul 10, 2025

    @Leonito2003

    Is there any news on this ? My flatpaks often fail to start because of an automount on Ubuntu 24.04, flatpak 1.14.7.

    At least a workaround would be nice, my mount is only available if a certain vpn is connected so most of the time it is unavailable

  15. 1 remaining item

  16. crepererum commented on Jul 24, 2025

    @crepererum

    Any workaround for this? Applications should not fail to start because a network mount is not connected.

    Here's what I did, but I'm not sure if that even counts as a "workaround": I was using systemd automounts, which had the effect that is described in this very ticket. I then removed the automount and just kept the .mount units, which I just start on demand (i.e. whenever I wanna access files from my NAS). So no automount anymore, but since I don't need it that often it's fine.

  17. Chocolateandmilkwin commented on Aug 21, 2025

    @Chocolateandmilkwin

    +1 I would love to be able to open my programs while my NAS is powered down.

    You really realize of much of a single point of failure flatpaks are, when you suddenly can't even open your browser to search for a solution to your problem.

  18. swick commented on Aug 21, 2025

    @swick
    Collaborator

    Getting rid of the xdg-dbus-proxy (for which we kind of have a long term plan) would fix this issue. Until then, I don't see how we could work around it.

  19. carpediem29 commented on Sep 14, 2025

    @carpediem29

    +1 I would love to be able to open my programs while my NAS is powered down.

    You really realize of much of a single point of failure flatpaks are, when you suddenly can't even open your browser to search for a solution to your problem.

    My Work around is to stop all automount services when I don't want to power up my NAS but we need this bug to be fixed.
    It's a pity : I moved my NAS mounts from autofs to systemd thinking this would be better.

  20. rriemann commented on Sep 17, 2025

    @rriemann

    I also bumped into this very issue. I had troubles to google this issue. So I drop here a few more keywords: I used autofs with systemd on Fedora to reach my NAS. Respective line in fstab:

    sun.local:/volume1/ /var/mnt/sun nfs rw,soft,timeo=120,x-systemd.automount,x-systemd.idle-timeout=180 0 0
    

    After trying several times to lauch Kmail, it worked eventually.

    Do you have a trick on how reliably get flatpak apps to work once faced with this issue?

  21. rriemann commented on Sep 18, 2025

    @rriemann

    I found a trick myself. With sudo journalctl -f I found out the name of the automount systemd unit (for me var-mnt-sun.automount). Then, I stopped it. My flatpak app that was hanging before opened immediately.

    sudo systemctl stop var-mnt-sun.automount
    

    check the status:

    sudo systemctl status var-mnt-sun.automount
    

    disabling permanently:

    sudo systemctl disable --now var-mnt-sun.automount
    
  22. carpediem29 commented on Sep 21, 2025

    @carpediem29

    @rriemann It's what I mentioned in my previous post.
    It's best to disable the Automount services (through systemctl disable) & just start them whenever we need to use our NAS.

  23. eumelzocker commented on Jun 13, 2026

    @eumelzocker

    Unfixed bug since almost 4 years...
    Came from Windows a couple of weeks ago. It seems like I bet on the wrong horse with my flatpack based distro...

  24. eblanshey commented on Jun 13, 2026

    @eblanshey

    It's possible that setting an NFS mount to be a "soft" rather than "hard" mount could solve the issue, as I didn't encounter it anymore for some time after making the change. I can't experiment anymore as I've switched to NixOS but hopefully it helps someone.

  25. smcv commented on Sep 22, 2026

    @smcv
    Collaborator

    [bubblewrap] needs to remount all mount points to apply MS_NODEV (if not using --dev-bind), MS_NOSUID (always), and MS_RDONLY (if using --ro-bind)

    With bubblewrap 0.13.0 (released today) on Linux kernel 5.2 or later, bubblewrap will attempt to use mount_setattr() to set mount flags recursively, without waiting for automount points to resolve.

    It's best to disable the Automount services (through systemctl disable) & just start them whenever we need to use our NAS

    If you have services that are not always available, then yes, I would recommend not having them be part of your filesystem in a known-non-working state when on networks where they are not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions