<div dir="ltr"><div>Hi again,</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">wt., 2 mar 2021 o 02:31 Simon McVittie <<a href="mailto:smcv@debian.org">smcv@debian.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 01 Mar 2021 at 22:48:47 +0100, Marcin Owsiany wrote:<br>
> I installed from debian-bullseye-DI-alpha3-amd64-netinst.iso in virt-manager VM<br>
> with 2 VCPUs and 4GB of RAM.<br>
> Other than selecting Polish locale and installing ssh server and all possible<br>
> display managers and window environments that debian-installer allows I don't<br>
> remember doing anything special.<br>
<br>
I hope that's pl_PL.UTF-8 rather than a non-Unicode character set?<br></blockquote><div><br></div><div>Yes, the latin2 nightmare is long gone :-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Installing all possible desktop environments probably results in each<br>
desktop environment having a "thundering herd" of session services all<br>
trying to jump in and do similar things at around the same time, so it<br>
doesn't entirely surprise me if some of them end up fighting.<br>
Unfortunately, the same pile of extra processes also obscures what is<br>
going on in the log.<br></blockquote><div><br></div><div>Right. I made yet another attempt to reproduce this, aiming for as short a journal log as I could.</div><div>The result is "just" 2570 lines this time. <a href="https://people.debian.org/~porridge/journal3.txt">https://people.debian.org/~porridge/journal3.txt</a></div><div>It also includes "logger" markers which I made from a single ssh session, which helps reduce the overall number of sessions.</div><div>It might serve better as a minimal repro for filing an upstream bug.</div><div><br></div><div>$ egrep --color 'Session [0-9a-f]|porridge\[[0-9]*\]:' journal3.txt <br>mar 02 22:37:39 debian systemd[1]: Started Session c1 of user Debian-gdm.<br>mar 02 22:38:10 debian systemd[1]: Started Session 2 of user porridge.<br>mar 02 22:38:22 debian porridge[5608]: ssh-logged-in<br>mar 02 22:38:35 debian porridge[5615]: cinnamon-starting-login<br>mar 02 22:38:36 debian systemd[1]: Started Session 4 of user porridge.<br>mar 02 22:38:47 debian systemd-logind[465]: Session c1 logged out. Waiting for processes to exit.<br>mar 02 22:38:49 debian porridge[7641]: cinnamon-starting-logout<br>mar 02 22:38:50 debian systemd-logind[465]: Session 4 logged out. Waiting for processes to exit.<br>mar 02 22:38:50 debian systemd[1]: Started Session c2 of user Debian-gdm.<br>mar 02 22:39:02 debian porridge[7905]: gnome-starting-login<br>mar 02 22:39:04 debian systemd[1]: Started Session 5 of user porridge.<br>mar 02 22:39:07 debian systemd-logind[465]: Session c2 logged out. Waiting for processes to exit.<br>mar 02 22:39:10 debian porridge[9464]: gnome-starting-screenlock<br>mar 02 22:39:24 debian porridge[9739]: gnome-attempting-unlock<br>mar 02 22:39:27 debian porridge[10824]: gnome-stuck<br>mar 02 22:39:29 debian porridge[10831]: ssh-logging-out<br>mar 02 22:39:30 debian systemd-logind[465]: Session 2 logged out. Waiting for processes to exit.<br>mar 02 22:39:36 debian systemd[1]: Started Session 6 of user porridge.<br></div><div><br></div><div>To summarize the above:</div><div>- c1 is the gdm session where I log into cinnamon</div><div>- 2 is my ssh session for calling logger</div><div>- 4 is the cinnamon X session</div><div>- c2 is the gdm session where I log into GNOME</div><div>- 5 is the GNOME session</div><div>- 6 is another ssh login, irrelevant </div><div><br></div><div>And now it's pretty clear that indeed gnome-shell for some reason thinks it belongs to session 4, while it's part of session 5.</div><div><br></div><div>$ grep NoSuchSession journal3.txt <br>mar 02 22:39:05 debian gnome-shell[7965]: JS ERROR: Could not get a proxy for the current session: Gio.IOErrorEnum: GDBus.Error:org.freedesktop.login1.NoSuchSession: No session '4' known<br></div><div><br></div><div>In fact, session 4 is reported to be gone for good 4 seconds before I even press ENTER after the password to log into GNOME:</div><div>mar 02 22:38:57 debian systemd-logind[465]: Removed session 4.<br>mar 02 22:39:02 debian porridge[7905]: gnome-starting-login<br></div><div><br></div><div>Now back to your questions from the previous time:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> To verify, I subsequently (without rebooting the VM) logged into and out of<br>
> Cinnamon session once more, and then logged into the GNOME session again<br>
> (without running the logger commands this time), and WAS able to reproduce the<br>
> issue. <br>
> <br>
> I have a full output of journalctl for that run of the VM, at [8]https://<br>
> <a href="http://people.debian.org/~porridge/journal.txt.gz" rel="noreferrer" target="_blank">people.debian.org/~porridge/journal.txt.gz</a> <br>
<br>
At what time did you log into and out of Cinnamon, and at what time did you<br>
log into GNOME?<br>
<br>
If they are the last ones in the log,</blockquote><div><br></div><div>Sorry, I didn't record the times, but yes, they should be the last two sessions in this order.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> then the timeline is:<br>
<br>
22:22:47 start to log in to Cinnamon on tty4, logind session 13<br>
22:22:58 gdm greeter on tty1 exits<br>
22:23:02 log out from Cinnamon<br>
22:23:03 gdm vt-switches back to tty1 and launches a new greeter<br>
22:23:08 logind session 13 ends<br>
22:23:16 start to log in to GNOME (session 15)<br>
<br>
This is where it gets confusing. systemd --user process 23531 seems to be<br>
trying to start a GNOME Shell session on Wayland and on X11 simultaneously<br>
(or something?) and then at 22:23:19 we see:<br>
<br>
> mar 01 22:23:19 debian gnome-shell[25939]: JS ERROR: Could not get a proxy for the current session: Gio.IOErrorEnum: GDBus.Error:org.freedesktop.login1.NoSuchSession: No session '13' known<br>
>                                            asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:131:23<br>
<br>
This means gnome-shell somehow thinks it's part of session 13 - perhaps<br>
because it's being run as a `systemd --user` per-user service, and your<br>
systemd --user instance still has traces of session 13 left over?<br>
<br>
But, meanwhile, at around the same time, the part of gnome-shell that is<br>
a polkit (policykit) agent connects to polkitd, and polkitd correctly<br>
identifies it as belonging to session 15...<br>
<br>
We end up with a GNOME Wayland session (was that deliberate?)<br></blockquote><div><br></div><div>There are two GNOME session types in the menu. I believe the one called just "GNOME" is indeed Wayland-based.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Then at 22:23:24 you log in via ssh and log "before-lock2".<br>
<br>
At 22:23:31, the gdm greeter exits.<br>
<br>
At 22:23:34, gdm unlocks the login keyring. Was that you trying to unlock<br>
the locked screen?<br></blockquote><div><br></div><div>If you mean a message such as "gdm-password][PID]: gkr-pam: unlocked login keyring" then yes, this appears exactly when I press enter after entering the password in the screen unlock dialog.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At 22:23:49, you log in via ssh to log "stuck".<br>
<br>
This looks to me as though there were enough lingering processes from<br>
session 13 that the gnome-shell that should be for session 15 somehow thinks<br>
it is part of session 15. I think that might be the root cause for the lock<br>
screen not unlocking: if GNOME Shell and gdm disagree on what the Shell's<br>
session ID is, then GNOME Shell telling gdm "please unlock session 13" or<br>
gdm telling GNOME Shell "if you are session 13, then please unlock" is<br>
not going to have the desired effect.<br>
<br>
If you can get the system into this state again, please look for the above<br>
message in the log, and then try to ssh in and run:<br>
<br>
    sudo loginctl<br>
    sudo loginctl unlock-session 13<br></blockquote><div><br></div><div>Here's the effect:</div><div><br></div><div>porridge@debian:~$ sudo loginctl<br>SESSION  UID USER     SEAT  TTY  <br>      5 1000 porridge seat0 tty3 <br>      6 1000 porridge       pts/0<br><br>2 sessions listed.<br>porridge@debian:~$ grep NoSuchSession journal3.txt <br>mar 02 22:39:05 debian gnome-shell[7965]: JS ERROR: Could not get a proxy for the current session: Gio.IOErrorEnum: GDBus.Error:org.freedesktop.login1.NoSuchSession: No session '4' known<br>porridge@debian:~$ sudo loginctl unlock-session 4<br>Failed to issue method call: No session '4' known<br></div><div>porridge@debian:~$ sudo loginctl unlock-session 5<br></div><div></div><div>porridge@debian:~$ </div><div><br></div><div>Nothing (apart from sudo) gets logged to journal when I run these unlock-session commands.</div><div>Neither is there any effect in the GUI. Still locked out.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">replacing 13 with the session ID from the error message. That might<br>
unlock the screen, or might at least give some useful information. Or,<br>
if it doesn't, try using a higher session ID.<br></blockquote><div><br></div><div>Just to be sure I also tried with session 6 (my ssh login) but that didn't help either :-)</div><div><br></div><div>I'd be curious to learn what mechanism gnome-shell used that gets fooled into thinking it's another session.</div><div>And why not just getenv("XDG_SESSION_ID")?</div><div><br></div><div>Marcin</div></div></div>