Skip to content

Can't use with home directory in /usr: bwrap: Can't mkdir parents for /usr/people/home/$USER #5035

Closed

Description

@realsobek

Checklist

Flatpak version

1.12.7

What Linux distribution are you using?

Fedora Linux

Linux distribution version

36

What architecture are you using?

x86_64

How to reproduce

  1. use account with NFS-based home directory
  2. install any flatpak from flathub.org
  3. start installed flatpak

Expected Behavior

Flatpak starts

Actual Behavior

Flatpak fails to start. Depending on flatpak with different error messages. See "additional information" for details.

Additional Information

I am using Fedora 36 (workstation installation, with Xfce desktop environment). My user account belongs to multiple groups. The home directory is on an NFS share.
The home directory uses symlinks to redirect to different servers for different users. This structure is in use for 20+ years. Details are at the bottom.

Locally installed and NFS-served applications work without problems.
All flatpaks I have tried (Octave, Gedit, Authenticator; all from flathub.org) install without problem, but fail to start. So this seems to be a general problem.
According to my notes I tested Flatpak for the first time with Fedora 28. Same problem. I did not report the issue. Back then flatpak was known to not support NFS-based home directories. Today, I cannot find any hints on https://flatpak.org, hence I am reporting this issue.

In the following text I replaced text with variables: $USER, $UID, $NAME, $GROUPADMIN, $GROUPADMINID, $GROUPUSER, $GROUPUSERID, $SERVER1, $SERVER1IPADDRESS

GEDIT

installation output:

$ flatpak install flathub org.gnome.gedit
Looking for matches…

org.gnome.gedit permissions:
    ipc                   fallback-x11          wayland       x11
    file access [1]       dbus access [2]

    [1] host, xdg-run/gvfsd
    [2] org.gtk.vfs.*


        ID                           Branch       Op      Remote       Download
 1. [✓] org.gnome.gedit.Locale       stable       i       flathub      59.6 kB / 4.1 MB
 2. [✓] org.gnome.gedit              stable       i       flathub       8.7 MB / 7.2 MB

Installation complete.

Fails to start:

$ flatpak run org.gnome.gedit
bwrap: Can't mkdir parents for /usr/people/home/$USER/.var/app/org.gnome.gedit/config/user-dirs.dirs: Read-only file system

Authenticator

installation output:

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub com.belmoussaoui.Authenticator
Looking for matches…
Required runtime for com.belmoussaoui.Authenticator/x86_64/stable (runtime/org.gnome.Platform/x86_64/42) found in remote flathub
Do you want to install it? [Y/n]: 

com.belmoussaoui.Authenticator permissions:
    ipc       network       fallback-x11          wayland
    x11       dri           dbus access [1]       bus ownership [2]

    [1] org.freedesktop.secrets
    [2] com.belmoussaoui.Authenticator.SearchProvider


        ID                                    Branch Op Remote  Download
 1. [✓] com.belmoussaoui.Authenticator.Locale stable i  flathub 106.7 kB / 7.5 MB
 2. [✓] org.freedesktop.Platform.GL.default   21.08  i  flathub 130.0 MB / 129.8 MB
 3. [✓] org.freedesktop.Platform.VAAPI.Intel  21.08  i  flathub  11.7 MB / 11.8 MB
 4. [✓] org.freedesktop.Platform.openh264     2.0    i  flathub   1.8 MB / 1.5 MB
 5. [✓] org.gnome.Platform.Locale             42     i  flathub  23.9 MB / 336.0 MB
 6. [✓] org.gnome.Platform                    42     i  flathub 252.6 MB / 276.2 MB
 7. [✓] com.belmoussaoui.Authenticator        stable i  flathub  19.0 MB / 18.6 MB

Installation complete.

Fails to start:

$ flatpak run com.belmoussaoui.Authenticator
Failed to create /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/cache for shader cache (No such file or directory)---disabling.
Failed to create /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/cache for shader cache (No such file or directory)---disabling.
2022-08-09T07:50:06.404169Z  INFO authenticator::application: Authenticator (com.belmoussaoui.Authenticator)
2022-08-09T07:50:06.404226Z  INFO authenticator::application: Version: 4.1.6 ()
2022-08-09T07:50:06.404236Z  INFO authenticator::application: Datadir: /app/share/authenticator

(authenticator:2): GLib-GIO-WARNING **: 09:50:06.408: Failed to create /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/config/glib-2.0/settings: Read-only file system
2022-08-09T07:50:06.409231Z  INFO authenticator::application: Migrating the secrets to the file backend
2022-08-09T07:50:06.544238Z ERROR authenticator::application: Failed to migrate your data Portal error IO error Read-only file system (os error 30)
thread 'main' panicked at 'Failed to create a pool: Read-only file system (os error 30)', src/models/database.rs:10:52
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The directory does exist, the file (and parent directory) does not:

$ ls -la /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/cache
total 16
drwxr-xr-x 4 $USER $GROUP 4096 Aug  9 15:02 .
drwxr-xr-x 6 $USER $GROUP 4096 Aug  9 15:02 ..
drwxr-xr-x 2 $USER $GROUP 4096 Aug  9 15:02 fontconfig
drwxr-xr-x 2 $USER $GROUP 4096 Aug  9 15:02 tmp

$ ls -la /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/config/
total 8
drwxr-xr-x 2 $USER $GROUP 4096 Aug  9 15:02 .
drwxr-xr-x 6 $USER $GROUP 4096 Aug  9 15:02 ..

Running with debug:

$ RUST_BACKTRACE=1 flatpak run com.belmoussaoui.Authenticator
...same as above...
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Running with extended debug:

$ RUST_BACKTRACE=full flatpak run com.belmoussaoui.Authenticator
...same as above, no "note" line but the following...
stack backtrace:
   0:     0x55e5cc360d7d - <unknown>
   1:     0x55e5cc3837ec - <unknown>
   2:     0x55e5cc35aac1 - <unknown>
   3:     0x55e5cc3628a5 - <unknown>
   4:     0x55e5cc362559 - <unknown>
   5:     0x55e5cc362df2 - <unknown>
   6:     0x55e5cc362cd7 - <unknown>
   7:     0x55e5cc361234 - <unknown>
   8:     0x55e5cc362a09 - <unknown>
   9:     0x55e5cbaa9303 - <unknown>
  10:     0x55e5cbaa93f3 - <unknown>
  11:     0x55e5cbd58696 - <unknown>
  12:     0x55e5cbbc644a - <unknown>
  13:     0x55e5cc336761 - <unknown>
  14:     0x55e5cba89a42 - <unknown>
  15:     0x55e5cbc31aaa - <unknown>
  16:     0x55e5cbdbd407 - <unknown>
  17:     0x55e5cbd42a02 - <unknown>
  18:     0x7f60562b7239 - g_type_create_instance
  19:     0x7f605629a48c - <unknown>
  20:     0x7f605629bdfa - g_object_newv
  21:     0x55e5cc32c460 - <unknown>
  22:     0x55e5cc32bf2b - <unknown>
  23:     0x55e5cbb9ec6d - <unknown>
  24:     0x55e5cbadcd5a - <unknown>
  25:     0x55e5cbca74e6 - <unknown>
  26:     0x55e5cbc082d3 - <unknown>
  27:     0x55e5cbd559c9 - <unknown>
  28:     0x55e5cc35464e - <unknown>
  29:     0x55e5cbca93f2 - <unknown>
  30:     0x7f60549c3b80 - __libc_start_main
  31:     0x55e5cbaa95ae - <unknown>
  32:                0x0 - <unknown>

Creating directory and file does not help:

$ mkdir -p /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/config/glib-2.0
$ flatpak run com.belmoussaoui.Authenticator
...error as above...
$ touch /usr/home/$USER/.var/app/com.belmoussaoui.Authenticator/config/glib-2.0/settings
$ flatpak run com.belmoussaoui.Authenticator
...error as above...

Information about user and NFS-based home directory:

$ id
uid=$UID($USER) gid=$GROUPADMINID($GROUPADMIN) groups=$GROUPADMINID($GROUPADMIN),$GROUPUSERID($GROUPUSER)

$ getent passwd $USER
$USER:*:$UID:$GROUPADMINID:$NAME:/usr/home/$USER:/bin/bash

$ mount | grep home
$SERVER1:/meta on /usr/home type nfs (ro,nosuid,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=$SERVER1IPADDRESS,mountvers=3,mountport=635,mountproto=tcp,local_lock=none,addr=$SERVER1IPADDRESS)
$SERVER1:/home on /usr/people/home type nfs (rw,nosuid,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=$SERVER1IPADDRESS,mountvers=3,mountport=635,mountproto=tcp,local_lock=none,addr=$SERVER1IPADDRESS)

$ ls -ld /usr/home
drwxr-xr-x 2 root root 32768 Jul  1 08:46 /usr/home
$ ls -l /usr/home/$USER
lrwxrwxrwx 1 root root 21 May  8  2009 /usr/home/$USER -> /usr/people/home/$USER

$ ls -ld /usr/people/
drwxr-xr-x. 3 root root 4096 Oct 20  2010 /usr/people/
$ ls -ld /usr/people/home
drwxr-xr-x 411 root root 32768 Jul  1 08:46 /usr/people/home
$ ls -ld /usr/people/home/$USER
drwx------ 95 $USER $GROUPUSER 32768 Aug  9 14:13 /usr/people/home/$USER

The group ownership is different for "${HOME}/.var" and all subfolders:

$ ls -ld /usr/people/home/$USER/.var
drwxr-xr-x 3 $USER $GROUPADMIN 4096 Aug  9 15:02 /usr/people/home/$USER/.var

Activity

  1. smcv commented on Aug 9, 2022

    @smcv
    Collaborator

    Flatpak does not support home directories (or other user-owned files) below /usr. This is because the runtime is defined to be a replacement for /usr, and the runtime is read-only, so we can't create mount points like /usr/people inside /usr.

    NFS or not-NFS has nothing to do with it.

  2. changed the title [-][Bug]: do NFS-based home directories prevent flatpaks from starting?[/-] [+]Can't use with home directory in /usr: bwrap: Can't mkdir parents for /usr/people/home/$USER[/+] on Aug 9, 2022
  3. realsobek commented on Aug 9, 2022

    @realsobek
    Author

    Thank you very much for explanation and help. Now I understand. I can reproduce the problem with a local account with local home directory in /usr/.

  4. hfiguiere commented on Feb 11, 2024

    @hfiguiere
    Collaborator

    It think this can be closed.

    We have better error messages.

    Trivia time: usr mean "Unix system resources" not a short for "user".

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