elementary/triage

First login after initial setup fails, subsequent logins work

Closed this issue · 8 comments

What Happened?

On a fresh install, I created a new user via Initial Setup then tried to login. That first login failed and kicked me back to the greeter. However, attempting to log in again (and every time since) has worked as expected. I have reproduced this on two different machines and in a VM.

Steps to Reproduce

  1. Perform a fresh install of elementary OS
  2. Create a user in Initial Setup
  3. Try to log in

Expected Behavior

The first login should work

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

Pinebook Pro (ARM, daily), Raspberry Pi 4 (ARM, daily), and GNOME Boxes (Intel 64-bit, stable).

vjr commented

Just a note that I was looking into this issue and apparently it is triggered due to initial-setup changing the hostname, whether during first boot, or if you run it again and add another user while also changing the hostname.

If you run initial-setup a second time from the command line the error like "gtk warning - cannot open display :0" is shown.

I noticed the same error in journalctl -e output from greeter, searching online seems to be something to do with hostname change affecting Xauthority/mit-magic-cookie or some such (for me) voodoo happening.

I dont know if the fix is to restart greeter after initial-setup quits, but could not so far figure out how to do it in the code of either.

@vjr well spotted! If you complete the setup without logging in and first rebooting your device the issue does not appear.

io.elementary.initial-setup is started by io.elementary.greeter: https://github.com/elementary/greeter/blob/2e9a2f22ad669bcbcd0a442c91589921cfc9ada4/src/MainWindow.vala#L478

@davidmhewitt is there any way we can restart the session after io.elementary.initial-setup has finished successfully? This should then hopefully restart Xorg and fix the issue.

@elementary/ux alternatively we could restart the device?

vjr commented

Would maybe using GLib.Subprocess.wait instead of AppInfo.launch help here?

Would be nice to just restart the greeter/Xorg instead of full system restart.

I finally have a fix for this, the bad news is that it means another distro-patch for now canonical/lightdm#288

@vjr thanks for your investigation, that was really important to understand the issue. I prefer having this fixed directly upstream with the patch above than having a workaround here. The good new is that it is only affecting Xorg.

vjr commented

@tintou that's great news, whatever is the cleaner solution of course to fix this issue.

I can confirm that it's fixed!