Default session fails when not started by a login manager

Bug #1871882 reported by Daniel Richard G.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-session (Ubuntu)
New
Undecided
Unassigned

Bug Description

This concerns gnome-session-bin 3.36.0-2ubuntu1 in Ubuntu focal.

When I log into a Xubuntu desktop via xrdp, an error occurs, and the session terminates before the desktop is even drawn on the screen.

I looked in syslog, and saw this:

    Apr 9 12:12:23 test-ubuntu64 systemd[1760]: Reached target Tasks to be run before GNOME Session starts.
    Apr 9 12:12:23 test-ubuntu64 systemd[1760]: Starting GNOME Session Manager (session: gnome)...
    Apr 9 12:12:23 test-ubuntu64 gnome-session[1900]: gnome-session-binary[1900]: CRITICAL: We failed, but the fail whale is dead. Sorry....
    Apr 9 12:12:23 test-ubuntu64 gnome-session-binary[1900]: CRITICAL: We failed, but the fail whale is dead. Sorry....
    Apr 9 12:12:23 test-ubuntu64 systemd[1760]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE

I edited /usr/lib/systemd/user/gnome-session-manager@.service to add the --debug option to the gnome-session-binary invocation, and tried again. Now I saw this:

    Apr 9 12:23:52 test-ubuntu64 systemd[2686]: Reached target Tasks to be run before GNOME Session starts.
    Apr 9 12:23:52 test-ubuntu64 systemd[2686]: Starting GNOME Session Manager (session: gnome)...
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Enabling debugging
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Enabling debugging
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): hardware acceleration already done if needed
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): hardware acceleration already done if needed
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Finding a graphical session for user 1000
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Finding a graphical session for user 1000
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Considering session 'c4'
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Considering session 'c4'
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Found session ID: c4
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Found session ID: c4
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Using systemd for session tracking
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Using systemd for session tracking
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: GLib-GIO-DEBUG(+): _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for \u2018gsettings-backend\u2019
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: GLib-GIO-DEBUG(+): _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for \u2018gsettings-backend\u2019
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): GsmManager: setting client store 0x559bf9e91e40
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): GsmManager: setting client store 0x559bf9e91e40
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): GsmXsmpServer: SESSION_MANAGER=local/test-ubuntu64:@/tmp/.ICE-unix/2818,unix/test-ubuntu64:/tmp/.ICE-unix/2818
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): GsmXsmpServer: SESSION_MANAGER=local/test-ubuntu64:@/tmp/.ICE-unix/2818,unix/test-ubuntu64:/tmp/.ICE-unix/2818#012
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): emitting SessionIsActive
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): emitting SessionIsActive
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Getting session 'gnome'
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Getting session 'gnome'
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /home/skunk/.config/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /home/skunk/.config/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/home/skunk/.config/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/home/skunk/.config/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /etc/xdg/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /etc/xdg/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/etc/xdg/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/etc/xdg/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/share/gnome/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/share/gnome/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/share/gnome/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/share/gnome/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/local/share/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/local/share/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/local/share/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/share/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/local/share/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /usr/share/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/share/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /var/lib/snapd/desktop/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: DEBUG(+): Cannot use session '/var/lib/snapd/desktop/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: gnome-session-binary[2818]: CRITICAL: We failed, but the fail whale is dead. Sorry....
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/usr/share/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): fill: *** Looking if /var/lib/snapd/desktop/gnome-session/sessions/gnome.session is a valid session file
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: DEBUG(+): Cannot use session '/var/lib/snapd/desktop/gnome-session/sessions/gnome.session': non-existing or invalid file.
    Apr 9 12:23:52 test-ubuntu64 gnome-session-binary[2818]: CRITICAL: We failed, but the fail whale is dead. Sorry....
    Apr 9 12:23:52 test-ubuntu64 systemd[2686]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE

It appears that gnome-session-binary is failing because it cannot find a valid session file. I copied a gnome.session file into /home/skunk/.config/gnome-session/sessions/, and tried again. Lo and behold, the login was successful (although the user was now running GNOME instead of Xubuntu/Xfce).

Given that the gnome-session-bin package functions incorrectly if it cannot find a gnome.session file (e.g. as provided by the gnome-session package), it should not be installable without one. A hard dependency on gnome-session seems appropriate.

Tags: focal
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, 'gnome-session' isn't installed by default on Ubuntu and there is no problem so that's not the issue. Do you use autologin? The user maybe has a local config pointing to a gnome session?

Changed in gnome-session (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel Richard G. (skunk) wrote :

Autologin is not in use. The only unusual aspect of this login is that it is via xrdp, and because no argument is passed to the initial /etc/X11/Xsession invocation, it uses the default x-session-manager -> gnome-session . If the user logs in via the console, xfce4-session is used instead, masking the problem.

(I tested with an empty user home directory, so there is no user config to confound the problem.)

On an Ubuntu desktop system, gnome-session-binary loads /usr/share/gnome-session/sessions/gnome-login.session which is provided by gdm3. So the dependency for gnome-session-bin could be stated as "gnome-session | gdm3".

The problem can be reproduced by using /usr/bin/gnome-session as the session manager, with neither the gnome-session nor gdm3 packages installed.

Changed in gnome-session (Ubuntu):
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, that makes more sense with those details added

summary: - gnome-session-bin package cannot function without gnome-session
+ Default session fails when not started by a login manager
Revision history for this message
Daniel Richard G. (skunk) wrote :

I'm not sure that this new title is accurate, as the error condition is brought about specifically by an unusual (albeit legal) way of starting the X session. My scenario involved xrdp, but I could see this happening with an older display manager (xdm?) that does not recognize XDG xsession files.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.