flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
43 stars 25 forks source link

Error calling Spawn(): org.freedesktop.DBus.Error.InvalidArgs #372

Closed Strahinja closed 5 months ago

Strahinja commented 5 months ago

The issue similar to #81 and https://github.com/flathub/com.discordapp.Discord/issues/349 is still happening for me after switching the repository URLs in Alpine Linux in /etc/apk/repositories to v3.19 from v3.18, upgrading the system and flatpak and rebooting.

F: Opening user flatpak installation at path /home/strajder/.local/share/flatpak
F: Opening user flatpak installation at path /home/strajder/.local/share/flatpak
F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening user flatpak installation at path /home/strajder/.local/share/flatpak
F: /home/strajder/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/23.08/315f529f41050948b4e202d16193d539b6b7f499e7b435725be3987ea113e29c/files/lib32 does not exist
F: Cleaning up unused container id 3028859731
F: Cleaning up per-app-ID state for com.github.Eloston.UngoogledChromium
F: Allocated instance id 1780597359
F: Add defaults in dir /com/github/Eloston/UngoogledChromium/
F: Add locks in dir /com/github/Eloston/UngoogledChromium/
F: Document portal not available, not mounting /run/flatpak/doc
F: Allowing homedir access
F: Not sharing "/run/.heim_org.h5l.kcm-socket" with sandbox: Unable to open path "/run/.heim_org.h5l.kcm-socket": No such file or directory
F: Allowing wayland access
F: Allowing x11 access
F: Allowing pulseaudio access
F: Pulseaudio user configuration file '/home/strajder/.config/pulse/client.conf': Error opening file /home/strajder/.config/pulse/client.conf: No such file or directory
F: Could not find pulseaudio socket
F: CUPS configuration file '/home/strajder/.cups/client.conf': Error opening file /home/strajder/.cups/client.conf: No such file or directory
F: CUPS configuration file '/etc/cups/client.conf': Error opening file /etc/cups/client.conf: No such file or directory
F: Failed to run in transient scope: No systemd user session available, cgroups not available
F: Running 'bwrap --args 34 xdg-dbus-proxy --args=36'
F: Running 'bwrap --args 34 chromium'
[2:10:0309/152217.351900:ERROR:flatpak_sandbox.cc(574)] Error calling Spawn(): org.freedesktop.DBus.Error.InvalidArgs: Could not find requesting pid
[9:9:0100/000000.371325:ERROR:zygote_linux.cc(668)] write: Broken pipe (32)
$ cat /home/strajder/.dbus/session-bus/<snip>-0
# This file allows processes on the machine with id <snip> using
# display :0.0 to find the D-Bus session bus with the below address.
# If the DBUS_SESSION_BUS_ADDRESS environment variable is set, it will
# be used rather than this file.
# See "man dbus-launch" for more details.
DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/dbus-<snip>,guid=<snip>'
DBUS_SESSION_BUS_PID=3095
DBUS_SESSION_BUS_WINDOWID=4194305

This line seems indicative:

/home/strajder/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/23.08/315f529f41050948b4e202d16193d539b6b7f499e7b435725be3987ea113e29c/files/lib32 does not exist
$ ls -l /home/strajder/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/23.08/315f529f41050948b4e202d16193d539b6b7f499e7b435725be3987ea113e29c/files/
total 128
drwxr-xr-x    2 strajder strajder     20480 Jan  1  1970 bin/
drwxr-xr-x   14 strajder strajder      4096 Mar  9 16:14 etc/
drwxr-xr-x    9 strajder strajder      4096 Jan  1  1970 lib/
drwxr-xr-x    2 strajder strajder      4096 Jan  1  1970 lib64/
drwxr-xr-x    7 strajder strajder      4096 Jan  1  1970 libexec/
-rw-r--r--    2 strajder strajder     86344 Jan  1  1970 manifest.json
lrwxrwxrwx    1 strajder strajder         3 Mar  9 16:14 sbin -> bin/
drwxr-xr-x   66 strajder strajder      4096 Jan  1  1970 share/

ie. the flatpak app expects to find the lib32 directory when the files in the flatpak are organized differently, as lib and lib64.

Erick555 commented 5 months ago

This line seems indicative:

It tells this path doesn't exist which is true and irrelevant. It happens for everyone.

Here's the example test command which will tell if this is problem with flatpak or dbus on your system. For 99% it's the latter. I see you don't have portals either.

Strahinja commented 5 months ago

Running that command gives:

$ flatpak run --command=flatpak-spawn com.github.Eloston.UngoogledChromium --sandbox echo 123
error: Unable to allocate instance id

Update: The command above was issued from the session started by slim, with the relevant parts of ~/.xinitrc:

#!/bin/sh
# ...

# WM override; if set, overrides and skips WM selection
WM=dwm
# List of WMs
wms="dwm:icewm-session:wmaker"

# ...

exec dbus-launch --exit-with-x11 -- env WM="$WM" wms="$wms" sh -c '{
        if [ ! $WM ]; then
                WM=$(printf "%s\n" "$wms" | tr : \\n |
                        dmenu -l 10 -fn "sans serif:size=24")
        fi
        /usr/libexec/pipewire-launcher
        $WM; }'

I managed to get Ungoogled Chromium running simply by stopping slim with

# rc-service slim stop

and logging from getty, while having

# ...

startx

in my ~/.profile. So it seems this is some kind of interaction of slim with dbus, not present in Alpine v3.18, but present in v3.19. I'll close the issue for now, even though this is a workaround. I haven't tested other DMs. I usually use autostart X at login (startx) on GNU/Linux, but I was testing slim for a couple of months on this particular system.

Summary of workaround: use autostart X at login, not slim.