systemd refuses to start secondary Xorg logins [<email address hidden>: Skipped due to 'exec-condition'.]

Bug #2006059 reported by Jurgen Schellaert
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gdm
Fix Released
Unknown
gdm3 (Ubuntu)
Fix Released
Medium
Unassigned
Jammy
Fix Released
Medium
Daniel van Vugt
Kinetic
Fix Released
Medium
Unassigned
Lunar
Fix Released
Medium
Unassigned

Bug Description

[ Impact ]

Switching to a second user falls back to Wayland even when Xorg was explicitly selected.

[ Test Plan ]

On an NVIDIA DGX Station (known to reliably reproduce the issue):
1. Start with a default Ubuntu 22.04 Desktop install
2. apt install linux-modules-nvidia-525-server-generic nvidia-driver-525-server -y
3. reboot (so new modules load)
4. Login to a desktop session
5. Create a new user using 'adduser'
6. Attempt to "switch to" the new user from the existing login

[ Where problems could occur ]

Any part of the login procedure as that is what is being modified.

[ Original Description ]

I have three accounts and I need all three to run on xorg instead of wayland.

For some reason, when switching accounts, two of them consistently start wayland even when I select plain gnome from the gdm menu. To get xorg, I need to log out and log in a second time.

A solution that is supposed to work consists in customizing /etc/gdm3/custom.conf (see https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/). This solution does not work.

I have also experimented with the following options:
DefaultSession=gnome-xorg.desktop
and
PreferredDisplayServer=xorg
Neither appears to set xorg as the default...

I have found the following bug reported upstream against gdm:
https://gitlab.gnome.org/GNOME/gdm/-/issues/733.
It looks like this was fixed a year ago but my system is still affected.

Note that I am using the gnome-session package. I doubt whether it makes any difference but I am adding it for the sake of completeness.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gdm3 42.0-1ubuntu7
ProcVersionSignature: Ubuntu 6.0.0-1010.10-oem 6.0.9
Uname: Linux 6.0.0-1010-oem x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: GNOME
Date: Sun Feb 5 19:44:53 2023
InstallationDate: Installed on 2022-03-27 (315 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220326)
SourcePackage: gdm3
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.gdm3.custom.conf: 2023-01-30T07:57:48.574915

Revision history for this message
Jurgen Schellaert (jurgen-schellaert-j) wrote :
description: updated
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In theory you should never see Wayland because you have:

  WaylandEnable=false

Although I recall when 22.04 was released, some unpredictability was observed in the choice of session on Nvidia hybrid (dual GPU) systems.

tags: added: nvidia
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please check for crashes (which gdm3 is designed to catch and that then causes the session type to change):

https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

Revision history for this message
Jurgen Schellaert (jurgen-schellaert-j) wrote (last edit ):

There are not any gdm crash reports in /var/crash. Neither do I find anything gdm related at https://errors.ubuntu.com/.

In my journalctl log, I do find this:
feb 07 02:29:00 Dapple systemd[53605]: Stopped GNOME Shell on X11.
feb 07 02:29:00 Dapple systemd[53605]: Starting GNOME Shell on X11...
feb 07 02:29:00 Dapple systemd[53605]: <email address hidden>: Skipped due to 'exec-condition'.
feb 07 02:29:00 Dapple systemd[53605]: Condition check resulted in GNOME Shell on X11 being skipped.

That sequence is repeated three times and then X11 appears to be replaced with wayland:
feb 07 02:29:00 Dapple gnome-shell[53866]: Running GNOME Shell (using mutter 42.5) as a Wayland display server
[...]
feb 07 02:29:01 Dapple gnome-shell[53866]: Enabling experimental feature 'x11-randr-fractional-scaling'
feb 07 02:29:01 Dapple gnome-shell[53866]: Enabling experimental feature 'scale-monitor-framebuffer'
feb 07 02:29:01 Dapple gnome-shell[53866]: Created gbm renderer for '/dev/dri/card0'
feb 07 02:29:01 Dapple dbus-daemon[53634]: [session uid=1001 pid=53634] Successfully activated service 'org.gtk.vfs.Metadata'
feb 07 02:29:01 Dapple systemd[53605]: Started Virtual filesystem metadata service.
feb 07 02:29:01 Dapple gnome-shell[53866]: Disabling DMA buffer screen sharing (implicit modifiers not supported)
feb 07 02:29:01 Dapple gnome-shell[53866]: Using public X11 display :2, (using :3 for managed services)
feb 07 02:29:01 Dapple gnome-shell[53866]: Using Wayland display name 'wayland-0'
[...]
feb 07 02:29:12 Dapple systemd[53605]: Started GNOME Shell on Wayland.
feb 07 02:29:12 Dapple systemd[53605]: Reached target GNOME Session is initialized.
feb 07 02:29:12 Dapple systemd[53605]: GNOME session X11 services is inactive.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm3 (Ubuntu):
status: New → Confirmed
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

All upstream references do seem to point to https://gitlab.gnome.org/GNOME/gdm/-/issues/733 but the "fix" for that is already in gdm3 version 41.3 and later. Yet the bug still happens.

Some people are focussed on the cgroup errors that come before it, but I'm not sure if they're really related:
https://www.reddit.com/r/gnome/comments/oknd9c/failed_to_start_application_launched_by/

summary: - gdm requires a second login to start xorg session instead of wayland
+ systemd refuses to start secondary Xorg logins
+ [org.gnome.Shell@x11.service: Skipped due to 'exec-condition'.]
Changed in gnome-session (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks like we even declared it fixed in bug 1945008.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try editing /<email address hidden> and comment out:

 # ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'

If that doesn't fix it then it would seem the issue is that Xorg hasn't been set up for us before we try to start gnome-shell on it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please also enable debug in /etc/gdm3/custom.conf and check for any crash reports in /var/crash/

Revision history for this message
Jurgen Schellaert (jurgen-schellaert-j) wrote :

I commented out the suggested line but the only effect is that switching accounts is now completely impossible. More specifically, it prevents me from getting past the login screen:
1. I select "switch user" from my running user session
2. I am sent to the login screen
3. I select a different user and submit the password
4. the screen goes black for a second
5.... and I find myself back at step 2
6. All I can do at this stage is log in again as my initial user

After enabling debugging in /etc/gdm3/custom.conf, /var/crash has received a pulseaudio related crash message. I see the owner is my initial user so I am not sure it has anything to do with my other user accounts. Should I append the crash file here as an attachment?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please report .crash files using the 'ubuntu-bug' command and never attach them to existing bugs.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Next steps:

1. Please check to see if the same bug exists in Ubuntu 22.10 or 23.04.

2. If the bug does still exist in later releases then report it at:
   https://gitlab.gnome.org/GNOME/gdm/-/issues

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Since I couldn't reproduce the bug with just an Intel GPU I'm wondering if Nvidia is a requirement to trigger this...

Revision history for this message
dann frazier (dannf) wrote :

I could not reproduce with kinetic (see my steps in bug 2016193). I went back to a clean jammy install, reproduced, then upgraded just the gdm3 packages to kinetic's versions, and the problem went away, so it seems gdm3 in isolation is the relevant difference. I took a look at the differences between the jammy and kinetic gdm3 source, and there really isn't that much different. One piece that stood out is the following, which appears to be a typo:

diff -urpN gdm3-42.0/daemon/gdm-local-display-factory.c gdm3-43.0/daemon/gdm-local-display-factory.c
--- gdm3-42.0/daemon/gdm-local-display-factory.c 2023-04-17 15:07:42.000000000 -0600
+++ gdm3-43.0/daemon/gdm-local-display-factory.c 2022-09-20 09:22:21.000000000 -0600
@@ -402,7 +402,7 @@ gdm_local_display_factory_create_transie
                 display = gdm_local_display_new ();
                 g_object_set (G_OBJECT (display),
                               "session-type", session_types[0],
- "supported-session-tyes", session_types,
+ "supported-session-types", session_types,
                               NULL);
                 is_initial = TRUE;
         }

On a lark, I rebuilt the jammy version of gdm3 to use "supported-session-types" here, and that seems to have fixed the problem for me. I can reliable downgrade to the jammy version of gdm3 and reproduce, and reliably *not* reproduce the bug after installing my patched version.

Revision history for this message
dann frazier (dannf) wrote :
Changed in gdm:
status: Unknown → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Wow, great work Dann! Would you like to distro patch it or shall I?

no longer affects: gnome-session (Ubuntu)
no longer affects: systemd (Ubuntu)
tags: added: fixed-in-gdm3-43.0 fixed-upstream
Changed in gdm3 (Ubuntu Jammy):
status: New → Confirmed
Changed in gdm3 (Ubuntu Kinetic):
status: New → Fix Released
Changed in gdm3 (Ubuntu Lunar):
status: Confirmed → Fix Released
Changed in gdm3 (Ubuntu Jammy):
importance: Undecided → Medium
Changed in gdm3 (Ubuntu Kinetic):
importance: Undecided → Medium
Changed in gdm3 (Ubuntu Lunar):
importance: Undecided → Medium
Changed in gdm3 (Ubuntu Jammy):
assignee: nobody → dann frazier (dannf)
status: Confirmed → Triaged
description: updated
Changed in gdm3 (Ubuntu Jammy):
assignee: dann frazier (dannf) → Daniel van Vugt (vanvugt)
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
dann frazier (dannf) wrote : Re: [Bug 2006059] Re: systemd refuses to start secondary Xorg logins [org.gnome.Shell@x11.service: Skipped due to 'exec-condition'.]

On Tue, Apr 18, 2023 at 12:36 AM Daniel van Vugt
<email address hidden> wrote:
>
> Wow, great work Dann! Would you like to distro patch it or shall I?

I'm happy either way, though I don't know the workflow vis-à-vis salsa here.

  -dann

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I remembered to try 22.04 this time, but still can't reproduce the bug with Intel graphics. Maybe Nvidia makes it more likely...

Could someone please fill in the [ Test Plan ] at the top in Bug Description?

Revision history for this message
dann frazier (dannf) wrote :

Test plan added to bug description.

description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks but I wonder if we can remove DGX from the test requirement. Perhaps just "Nvidia driver" (not sure if a hybrid would work or it has to be a purely Nvidia system).

Revision history for this message
dann frazier (dannf) wrote :

On Wed, Apr 19, 2023, 21:25 Daniel van Vugt <email address hidden>
wrote:

> Thanks but I wonder if we can remove DGX from the test requirement.
> Perhaps just "Nvidia driver" (not sure if a hybrid would work or it has
> to be a purely Nvidia system).

Perhaps just "a system on which this issue is reproducible"? I don't know
how to state anything less equivocal.

Changed in gdm3 (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Jurgen, or anyone else affected,

Accepted gdm3 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdm3/42.0-1ubuntu7.22.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-jammy
Revision history for this message
dann frazier (dannf) wrote :
tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Jurgen Schellaert (jurgen-schellaert-j) wrote :

I have installed the package from proposed, rebooted and now the login process is finally working as it should. Well done!

Revision history for this message
dann frazier (dannf) wrote :

Good to hear, thanks for confirming @jurgen-schellaert-j!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (gdm3/42.0-1ubuntu7.22.04.2)

All autopkgtests for the newly accepted gdm3 (42.0-1ubuntu7.22.04.2) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

systemd/249.11-0ubuntu3.9 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#gdm3

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Seems like the above issue has cleared already?

Revision history for this message
dann frazier (dannf) wrote :

Yeah, looks like that test has a history of timing out, so I re-ran it and it passed this time.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

i think this SRU has triggered unexpected failure to start gdm (potentially unrelated to the content of this sru)

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Tyler Lesthaeghe (lesthaeghet) wrote :

I can also confirm the bug under the same circumstances. Installing the proposed 42.0-1ubuntu7.22.04.2 package fixes the issue for me as well. Thanks for the quick turnaround on this!

description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I verified the test results and am satisfied that they show the executed planned test case, and that the results are correct.

Nice find, dannf! :)

The package built correctly in all architectures and Ubuntu releases it was meant for.

There are no DEP8 regressions.

There is no SRU freeze ongoing at the moment.

There is no halted phasing on the previous update.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm3 - 42.0-1ubuntu7.22.04.2

---------------
gdm3 (42.0-1ubuntu7.22.04.2) jammy; urgency=medium

  [ Daniel van Vugt ]
  * Add local-display-factory-Fix-typo-in-supported-session-types.patch:
    To fix unreliable session type selection (LP: #2006059)

 -- Sebastien Bacher <email address hidden> Thu, 20 Apr 2023 15:27:53 +0200

Changed in gdm3 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for gdm3 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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