Schneegans / gnome-shell-pod

:package: A Podman container which runs GNOME Shell in xvfb
MIT License
47 stars 12 forks source link

The service org.gnome.Shell.Extensions crashes frequently #2

Closed Schneegans closed 3 years ago

Schneegans commented 3 years ago

This causes operations like gnome-extensions-app or gnome-extensions prefs to fail. The behavior seems to differ slightly among the different container images.

GNOME Shell 3.36.7 (Ubuntu 20.04)

  1. To reproduce this, first run the container:

    podman run --rm -ti ghcr.io/schneegans/gnome-shell-3.36:latest
  2. In another shell, you can watch the log output:

    podman exec $(podman ps -q -n 1) journalctl -f -o cat
  3. Now try to open the extensions app by executing this inside the interactive container:

    gnome-extensions-app
  4. It crashes and the following log messages are printed:

    [session uid=1000 pid=146] Activating service name='org.gnome.Shell.Extensions' requested by ':1.33' (uid=1000 pid=710 comm="gnome-extensions prefs flypie@schneegans.github.co" label="unconfined")
    Unable to init server: Could not connect: Connection refused
    cannot open display: 
    [session uid=1000 pid=146] Activated service 'org.gnome.Shell.Extensions' failed: Process org.gnome.Shell.Extensions exited with status 1
  5. This works however if manually start the service in the container:

    gjs /usr/share/gnome-shell/org.gnome.Shell.Extensions &
    
    # This works now.
    gnome-extensions-app
  6. You can capture a screenshot by running this command (requires imagemagick):

    podman cp $(podman ps -q -n 1):/home/gnomeshell/Xvfb_screen0 . && convert xwd:Xvfb_screen0 capture.jpg && eog capture.jpg
  7. Now press Ctrl-C to kill the gnome-extensions-app. If you now try to run the following command, the extension services crashes:

    gnome-extensions list

I guess there are some questions here: Why is the extension service not running at startup? Why can't it be activated via D-Bus? Why is it crashing when calling gnome-extensions list?

The cannot open display and connection refused errors look like some environment issues... You can check env in the container:

SHELL=/bin/bash
XDG_SEAT=seat0
PWD=/home/gnomeshell
LOGNAME=gnomeshell
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/gnomeshell
LANG=C.UTF-8
XDG_SESSION_CLASS=user
TERM=vt102
USER=gnomeshell
DISPLAY=:99
SHLVL=1
XDG_SESSION_ID=3
XDG_RUNTIME_DIR=/run/user/1000
HUSHLOGIN=FALSE
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/mail/gnomeshell
_=/usr/bin/env

GNOME Shell 3.38.2 (Ubuntu 20.10)

This can be run with:

podman run --rm -ti ghcr.io/schneegans/gnome-shell-3.38:latest

Now you can follow the steps 2, 3, and 4 above. The however, in step 5, manually starting the extension service does not work. The process crashes after about two seconds without any message.

GNOME Shell 40.0 (Ubuntu 21.04)

This can be run with:

podman run --rm -ti ghcr.io/schneegans/gnome-shell-40.0:latest

It behaves exactly like the 3.38 container.

Schneegans commented 3 years ago

It works now. The problem was that the session bus launched by systemd did not have the correct DISPLAY variable set. Launching a new session bus for GNOME Shell fixes the issue.