Wayland infinite login loop

I switched from Xorg to Wayland and everything worked fine until it suddenly did not. I can not switch back to Xorg because that gives similar errors. The baffling thing is that sudo startx works - this means something somewhere is not able to access/do something that it needs to but more importantly it confirms it is not a driver or hardware or such a problem.

Link to journalctl

$ dbus-run-session -- gnome-shell --display-server wayland

dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gtk.vfs.Daemon' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.gtk.vfs.Daemon'
libmutter-Message: 21:35:51.191: Running GNOME Shell (using mutter 48.2) as a Wayland display server
libmutter-Message: 21:35:51.258: Thread 'KMS thread' will be using high priority scheduling
libmutter-Message: 21:35:51.281: Device '/dev/dri/card0' prefers shadow buffer
libmutter-Message: 21:35:51.283: Added device '/dev/dri/card0' (nvidia-drm) using atomic mode setting.
libmutter-Message: 21:35:51.285: Created gbm renderer for '/dev/dri/card0'
libmutter-Message: 21:35:51.285: GPU /dev/dri/card0 selected primary from builtin panel presence
** Message: 21:35:51.286: Obtained a high priority EGL context
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.a11y.Bus' requested by ':1.3' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.a11y.Bus'
libmutter-Message: 21:35:52.286: Using public X11 display :0, (using :1 for managed services)
libmutter-Message: 21:35:52.286: Using Wayland display name 'wayland-0'
dbus-daemon[1510]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1510]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.Shell.Screencast' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.freedesktop.impl.portal.PermissionStore' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.Shell.CalendarServer' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.evolution.dataserver.Sources5' requested by ':1.9' (uid=1000 pid=1535 comm="/usr/lib/gnome-shell-calendar-server")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=1000 pid=1456 comm="gnome-shell --display-server wayland")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'ca.desrt.dconf'
GNOME Shell-Message: 21:35:52.690: Failed to create file /run/user/1000/gnome-shell-disable-extensions: Error opening file “/run/user/1000/gnome-shell-disable-extensions”: File exists

(gnome-shell:1456): Gjs-CRITICAL **: 21:35:52.697: JS ERROR: Gio.IOErrorEnum: Gio.IOErrorEnum: Error removing file /home/rkochar/.local/share/gnome-shell/extension-updates/pwcalc@thilomaurer.de: Directory not empty

Stack trace:
  recursivelyDeleteDir@resource:///org/gnome/shell/misc/fileUtils.js:62:13
  _installExtensionUpdates@resource:///org/gnome/shell/ui/extensionSystem.js:673:27
  init@resource:///org/gnome/shell/ui/extensionSystem.js:75:14
  _initializeUI@resource:///org/gnome/shell/ui/main.js:329:22
  start@resource:///org/gnome/shell/ui/main.js:180:11
  @resource:///org/gnome/shell/ui/init.js:12:47
  @resource:///org/gnome/shell/ui/init.js:21:20
  
@resource:///org/gnome/shell/ui/init.js:21:20

** Message: 21:35:52.697: Execution of main.js threw exception: Module resource:///org/gnome/shell/ui/init.js threw an exception
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.OnlineAccounts' requested by ':1.10' (uid=1000 pid=1547 comm="/usr/lib/evolution-source-registry")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.Sources5'
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.evolution.dataserver.Calendar8' requested by ':1.9' (uid=1000 pid=1535 comm="/usr/lib/gnome-shell-calendar-server")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.gnome.Shell.CalendarServer'
/usr/lib/goa-daemon: symbol lookup error: /usr/lib/libadwaita-1.so.0: undefined symbol: gtk_widget_set_limit_events
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activated service 'org.gnome.OnlineAccounts' failed: Process org.gnome.OnlineAccounts exited with status 127

(evolution-source-registry:1547): module-gnome-online-accounts-WARNING **: 21:35:52.740: Unable to connect to the GNOME Online Accounts service: Error calling StartServiceByName for org.gnome.OnlineAccounts: Process org.gnome.OnlineAccounts exited with status 127
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.Calendar8'
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activating service name='org.gnome.evolution.dataserver.AddressBook10' requested by ':1.12' (uid=1000 pid=1569 comm="/usr/lib/evolution-calendar-factory")
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.AddressBook10'
(EE) could not connect to wayland server

(org.gnome.Shell.Screencast:1518): Gtk-WARNING **: 21:35:53.252: Failed to open display
dbus-daemon[1455]: [session uid=1000 pid=1455 pidfd=5] Activated service 'org.gnome.Shell.Screencast' failed: Process org.gnome.Shell.Screencast exited with status 1
A connection to the bus can't be made
gnome-shell-calendar-server[1535]: Lost (or failed to acquire) the name org.gnome.Shell.CalendarServer - exiting

(evolution-calendar-factory:1569): libedbus-private-WARNING **: 21:35:53.269: Error setting property 'ConnectionStatus' on interface org.gnome.evolution.dataserver.Source: The connection is closed (g-io-error-quark, 18)

Try again with x11 and journalctl.

$ dbus-run-session -- gnome-shell --display-server x11


dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gtk.vfs.Daemon' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.gtk.vfs.Daemon'
libmutter-Message: 00:45:59.188: Running GNOME Shell (using mutter 48.2) as a Wayland display server
libmutter-Message: 00:45:59.592: Thread 'KMS thread' will be using high priority scheduling
libmutter-Message: 00:45:59.592: Device '/dev/dri/card0' prefers shadow buffer
libmutter-Message: 00:45:59.594: Added device '/dev/dri/card0' (nvidia-drm) using atomic mode setting.
libmutter-Message: 00:45:59.596: Created gbm renderer for '/dev/dri/card0'
libmutter-Message: 00:45:59.596: GPU /dev/dri/card0 selected primary from builtin panel presence
** Message: 00:45:59.599: Obtained a high priority EGL context
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.a11y.Bus' requested by ':1.3' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.a11y.Bus'
libmutter-Message: 00:46:00.625: Using public X11 display :0, (using :1 for managed services)
libmutter-Message: 00:46:00.625: Using Wayland display name 'wayland-0'
dbus-daemon[1293]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1293]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.Shell.Screencast' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.freedesktop.impl.portal.PermissionStore' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.Shell.CalendarServer' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.evolution.dataserver.Sources5' requested by ':1.9' (uid=1000 pid=1333 comm="/usr/lib/gnome-shell-calendar-server")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=1000 pid=1233 comm="gnome-shell --display-server x11")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'ca.desrt.dconf'
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.OnlineAccounts' requested by ':1.11' (uid=1000 pid=1345 comm="/usr/lib/evolution-source-registry")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.Sources5'
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.evolution.dataserver.Calendar8' requested by ':1.9' (uid=1000 pid=1333 comm="/usr/lib/gnome-shell-calendar-server")
/usr/lib/goa-daemon: symbol lookup error: /usr/lib/libadwaita-1.so.0: undefined symbol: gtk_widget_set_limit_events
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activated service 'org.gnome.OnlineAccounts' failed: Process org.gnome.OnlineAccounts exited with status 127

(evolution-source-registry:1345): module-gnome-online-accounts-WARNING **: 00:46:01.236: Unable to connect to the GNOME Online Accounts service: Error calling StartServiceByName for org.gnome.OnlineAccounts: Process org.gnome.OnlineAccounts exited with status 127

(gnome-shell:1233): Gjs-CRITICAL **: 00:46:01.243: JS ERROR: Gio.IOErrorEnum: Gio.IOErrorEnum: Error removing file /home/rkochar/.local/share/gnome-shell/extension-updates/pwcalc@thilomaurer.de: Directory not empty

Stack trace:
  recursivelyDeleteDir@resource:///org/gnome/shell/misc/fileUtils.js:62:13
  _installExtensionUpdates@resource:///org/gnome/shell/ui/extensionSystem.js:673:27
  init@resource:///org/gnome/shell/ui/extensionSystem.js:75:14
  _initializeUI@resource:///org/gnome/shell/ui/main.js:329:22
  start@resource:///org/gnome/shell/ui/main.js:180:11
  @resource:///org/gnome/shell/ui/init.js:12:47
  @resource:///org/gnome/shell/ui/init.js:21:20
  
@resource:///org/gnome/shell/ui/init.js:21:20

** Message: 00:46:01.243: Execution of main.js threw exception: Module resource:///org/gnome/shell/ui/init.js threw an exception
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.gnome.Shell.CalendarServer'
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.Calendar8'
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activating service name='org.gnome.evolution.dataserver.AddressBook10' requested by ':1.12' (uid=1000 pid=1369 comm="/usr/lib/evolution-calendar-factory")
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Successfully activated service 'org.gnome.evolution.dataserver.AddressBook10'
(EE) could not connect to wayland server

(org.gnome.Shell.Screencast:1316): Gtk-WARNING **: 00:46:01.808: Failed to open display
dbus-daemon[1232]: [session uid=1000 pid=1232 pidfd=5] Activated service 'org.gnome.Shell.Screencast' failed: Process org.gnome.Shell.Screencast exited with status 1
A connection to the bus can't be made
gnome-shell-calendar-server[1333]: Lost (or failed to acquire) the name org.gnome.Shell.CalendarServer - exiting

(evolution-calendar-factory:1369): libedbus-private-WARNING **: 00:46:01.814: Error setting property 'ConnectionStatus' on interface org.gnome.evolution.dataserver.Source: The connection is closed (g-io-error-quark, 18)

(evolution-addressbook-factory:1394): libedbus-private-WARNING **: 00:46:01.815: Error setting property 'ConnectionStatus' on interface org.gnome.evolution.dataserver.Source: The connection is closed (g-io-error-quark, 18)

I may have heard of it (have never had a problem myself) - where have you heard of it?

One way to approach this is to:
look at the Xorg.0.log - or the older ones - for clues

location:
~/.local/share/xorg/Xorg.0.log

I don’t know where the gdm debug output will be written to - probably to the journal.

another way:
stop and disable gdm and start the session manually

go to a TTY, log in and:

systemctl stop gdm
systemctl disable gdm

startx

I don’t know the command to start a wayland session in a similar way.

to enable gdm again:
systemctl enable gdm


That might filter out too much/the wrong things.
Just inspect the log in full:

journalctl -r
(lists the log in reverse - newest first)

for example

This is a great idea, I discovered the true error parse_vt_settings: Cannot open /dev/tty0 (permission denied).

To test the theory, sudo startx does work as expected. whoami gives root.

startx goes to the error page and then back to tty.

And some other posts here but I am not convinced these will help me because I don’t see any driver issues. I suspect it is a permissions issue.

It is inconvenient to reply to the other comments on phone, will answer as soon as my laptop is up and running.

No need for root or sudo.
For none of the commands.

I didn’t think you’d log in as root, nor advise it.
Just use your regular user.

Never run the graphical session as root.
If you do - it’ll then, of course, not be your normal users session.

1 Like

Indeed, I could not think of another way to confirm the problem.

Logging my steps for future.

sudo usermod -aG tty yourname
Problem persists however journalctl is now showing several errors including stacktrace with JavaScript code. I wasn’t expecting to see that but journalctl -r was also a great suggestion.

It had “org.freedesktop.DBus.Error.NameHasNoOwner:” leading to this post with a similar error. The answer in the post suggests systemctl status dbus which also contains more errors such as

Activation request for 'org.freedesktop.resolve1' failed: The systems unit 'dbus-org.freedesktop.resolve1.service' could not be found.
Activation request for 'org.freedesktop.Avahi1' failed: The systems unit 'dbus-org.freedesktop.Avahi1.service' could not be found.
Activation request for 'org.freedesktop.home1' failed: The systems unit 'dbus-org.freedesktop.home1.service' could not be found.

The first 2 are solved by this post. What is the relation between NetworkManager and Xorg?

Currently, journal complains that WARNING: DBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.systemd1" does not exist which leads to early KMS. Still have the same error.

Circling back, sudo startx worked, what am I missing?

This could mess up the permissions of some files in your $HOME directory - and it probably already has.
Check your $HOME directory for any files (hidden files especially) owned by root.

startx works just fine without sudo - xorg is not supposed to be run as root

While it doesn’t hurt anything (as far as I know), it was also unnecessary.

Nothing more that I can say here with the available information.

Nothing is owned by root. I disabled wifi, bluetooth and other things polluting logs and have added the journals for both cases.

This:

seems to point to some locally installed extension, specifically this one:

Review "Password Calculator" version 25 - GNOME Shell Extensions

I’d - at least temporarily - remove all locally installed extensions.

If startx works (not as root, not with sudo),
then the next suspect is the GDM configuration.

anything in /etc/gdm/

Perhaps the tail end of the system log provides some clue.
Disable and stop gdm
systemctl stop gdm
systemctl disable gdm

systemctl start gdm

look at the (reverse ordered) log after this

journalctl -r

don’t forget to enable gdm again or it won’t (try to) start automatically anymore

systemctl enable gdm

(sorry - I already suggested this as I just saw
Nothing came of it?)

That’s not entirely correct. Even though there are ways to completely do without a root-owned X11 process, under normal conditions there will be two X11 processes running, i.e. one as root (for the display manager) and one under the UID of the user (for the desktop environment or window manager).

The reason why the display manager runs with root privileges by default is that it has to be able to authenticate you upon login, which requires read access to /etc/shadow.

With systemd and logind, this can be circumvented, but the default configuration still has X11 running a root session for the display manager for in the event that the operating system does not use systemd and/or logind.

That said, running startx with sudo privileges is of course a bad idea, because it’ll run your entire GUI session with root privileges, and could then indeed mess up the permissions in your home directory.

startx should never be executed by root or with sudo.

I know.

And that is what I meant by saying what I said.

1 Like

Sorry for not being explicit, this process gives significantly more verbose logs than the dbus command. The stacktrace and weird error to the Password calculator is also present.

In /etc/gdm,
It is completely normal and minimal - mainly a custom.conf that enables Wayland and debugging.

$ gnome-extensions list
Failed to connect to GNOME shell

I am in the quiet 3 boot (instead of splash). The pwcalc dir in ~/.local/gnome-shell, I had to delete it twice, in extensions and extension-updates. In extensions is was empty however in extension-update it had a file called settings-importexport.ui that was symlinked to settings-importexport.cmb.ui which did not exist.

Somehow the symlink broke and it wrecked everything. Thank you for sticking by. I will mark your post as the answer because it gives the process to solve the problem.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.