Skip to main content
Topic: Flatpaks won't start  (Read 512 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Flatpaks won't start

Hello. I am having a problem with Flatpak Firefox (well all Flatpaks really). It just will not start. In terminal, it produces the following:

Code: [Select]
F: Can't get document portal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.portal.Documents exited with status 2
[3, Main Thread] WARNING: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop”: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201

(org.mozilla.firefox:3): Gdk-WARNING **: 11:18:43.282: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop”

I do have xdg-document-portal, xdg-document-portal-gtk and xdg-document-portal-gnome installed, but there is not xdg-document-portal service (when I consulted an LLM with this it produced a sample service output to be put into /etc/init.d, rc-update would add it, but rc-service said it didn't exist).

Here is how my .zshrc looks (the modified preferences when trying to solve this issue):
Code: [Select]
pid_gnome=$(pgrep gnome-session)
DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/${pid_gnome}/environ|cut -d= -f2-)
export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}

#export $(dbus-launch)
#export DBUS_SESSION_BUS_ADDRESS=
export XDG_CURRENT_DESKTOP=gnome
export ENABLE_WAYLAND=1
export XDG_SESSION_TYPE=wayland
export ELECTRON_OZONE_PLATFORM_HINT=auto
#export DISPLAY=:0
export WAYLAND_DISPLAY=wayland-0
#export DBUS_SESSION_BUS_ADDRESS=$(dbus-launch --autolaunch=$(printenv XDG_RUNTIME_DIR) --binary-syntax --close-stderr)
#export GTK_USE_PORTAL=1
emulate sh -c 'source /etc/profile'

source /etc/profile
export XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/share/:/usr/local/share/:/home/f/Downloads:/home/f/Documents:/home/f/.var/app/:$XDG_DATA_DIRS"

XDG_DOWNLOAD_DIR="$HOME/Downloads"
#XDG_DOWNLOAD_DIR="$HOME/Documents"
#export XDG_DATA_DIRS="$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/usr/share/:/usr/local/share/:/home/f/Downloads:/home/f/Documents:/home/f/.local/share/flatpak/exports/share:/home/f/.var/app/"

One thing I've noticed is my DBUS_SESSION_BUS_ADDRESS isn't pretty as it should be '/etc/iser/1000 or so' but it's something like 'unix:path=/tmp/dbus-LDJDHCJDJKEJFKDJJD,guid=pwkcklkdkekcjksk'.

I'm on Artix OpenRC GNOME hardened.

I would greatly appreciate some help, because I have spent a whole day yesterday just trying to get my browser to work.


Re: Flatpaks won't start

Reply #2
Does this also happen with a non-hardened kernel? How about in other-than-Gnome DE?

The same happens on hardened/non-hardened, GNOME/Cinnamon, Wayland/X11. (When I tried uninstalling Cinnamon suspecting some incompatibility with xdg-document-portal-xapp, the desktop somehow broke and I couldn't boot after a reboot.)

Re: Flatpaks won't start

Reply #3
I'm not a flatpak expert, the only thing that comes to mind right now is trying with a completely blank $HOME user account (as in no ~/.config, ~/.local, etc. whatsoever).

Re: Flatpaks won't start

Reply #4
A-ha! With a new user profile, the flatpaks indeed start just fine. We're on to something.

Re: Flatpaks won't start

Reply #5
So it is probably something in user config preventing the Flatpaks from starting.

Re: Flatpaks won't start

Reply #6
I thought I'd give up and start a new user profile and migrate my user config there but no... When I copied my zsh, firefox and thunderbird configs, they all stop working too. Probably some permission issues. This is so frustrating.

Re: Flatpaks won't start

Reply #7
I thought I'd give up and start a new user profile and migrate my user config there but no... When I copied my zsh, firefox and thunderbird configs, they all stop working too. Probably some permission issues. This is so frustrating.
Did you chown the files to the new user ? Otherwise you are bound to have a permissions issue.

Re: Flatpaks won't start

Reply #8
My no. 1 suspicion is the zsh profile file (especially re-setting DBUS_SESSION_BUS_ADDRESS - shouldn't the terminal application inherit it from the graphical session in the first place?).

Re: Flatpaks won't start

Reply #9
OK so I didn't know I had to chown to change the ownership of the copied files. I did that and now it works (thanks gripped). And by 'works' I mean both Flatpak Firefox and Thunderbird will start and run.

There are still few caviats: 1. When running Firefox from terminal it still complains:
Code: [Select]
F: Can't get document portal: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
[2, Main Thread] WARNING: Settings portal not found: Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201

(org.mozilla.firefox:2): Gdk-WARNING **: 09:28:40.135: Settings portal not found: Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached
[Parent 2, Main Thread] WARNING: Failed to execute child process “update-desktop-database” (No such file or directory): 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:201

(org.mozilla.firefox:2): GLib-GIO-WARNING **: 09:28:52.633: Failed to execute child process “update-desktop-database” (No such file or directory)
and Thunderbird:
Code: [Select]
F: Can't get document portal: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
[2, Main Thread] WARNING: Settings portal not found: Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:187

(org.mozilla.Thunderbird:2): Gdk-WARNING **: 09:31:01.804: Settings portal not found: Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached
[Parent 2, Main Thread] WARNING: Running in confined mode, using Portal notifications. Some features and hints won't be supported: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:187

(org.mozilla.Thunderbird:2): libnotify-WARNING **: 09:31:46.885: Running in confined mode, using Portal notifications. Some features and hints won't be supported
[ERROR style::stylesheets::rule_parser] Saw @import rule, but no way to trigger the load
and it takes them time to load (~30 secs).

2. Running Firefox Flatpak via menu opens it in dark mode (expected), but running the same from terminal yields upper menu light (!?).

3. (capezotte)  ~ ▓▒░ echo $DBUS_SESSION_BUS_ADDRESS still outputs:                            
Code: [Select]
unix:path=/tmp/dbus-ItHnYOcQzc,guid=54917de0644cbbfc9167c78467e1183f
When i uncomment
Code: [Select]
export DBUS_SESSION_BUS_ADDRESS=$(dbus-launch --autolaunch=$(printenv XDG_RUNTIME_DIR) --binary-syntax --close-stderr)
new terminal window outputs:
Code: [Select]
[WARNING]: Console output during zsh initialization detected.

When using Powerlevel10k with instant prompt, console output during zsh
initialization may indicate issues.

You can:

  - Recommended: Change ~/.zshrc so that it does not perform console I/O
    after the instant prompt preamble. See the link below for details.

    * You will not see this error message again.
    * Zsh will start quickly and prompt will update smoothly.

  - Suppress this warning either by running p10k configure or by manually
    defining the following parameter:

      typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

    * You will not see this error message again.
    * Zsh will start quickly but prompt will jump down after initialization.

  - Disable instant prompt either by running p10k configure or by manually
    defining the following parameter:

      typeset -g POWERLEVEL9K_INSTANT_PROMPT=off

    * You will not see this error message again.
    * Zsh will start slowly.

  - Do nothing.

    * You will see this error message every time you start zsh.
    * Zsh will start quickly but prompt will jump down after initialization.

For details, see:
https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt

-- console output produced during zsh initialization follows --

machine ID '/run/user/1003' looks like it's the wrong length, should be 32 hex digits%  
and echo $DBUS_SESSION_BUS_ADDRESS output is empty.

Re: Flatpaks won't start

Reply #10

Flatpak is Potterware.

https://en.wikipedia.org/wiki/Flatpak
https://de.wikipedia.org/wiki/Flatpak
https://www.superlectures.com/guadec2013/sandboxed-applications-for-gnome
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

 
Artix forum uses a single cookie to remember youOK