elementary / triage

Catch-all repo for issues that don't have a better home
https://elementary.io
4 stars 2 forks source link

First login after initial setup fails, subsequent logins work #92

Closed cassidyjames closed 1 year ago

cassidyjames commented 2 years ago

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 1 year ago

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.

meisenzahl commented 1 year ago

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

meisenzahl commented 1 year ago

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 1 year ago

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.

tintou commented 1 year ago

I finally have a fix for this, the bad news is that it means another distro-patch for now https://github.com/canonical/lightdm/pull/288

tintou commented 1 year ago

@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 1 year ago

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

danirabbit commented 1 year ago

I can confirm that it's fixed!