Sometimes I can't log in to xfce screenlocker or shell


With my setup (NixOS 23.05, HM, flakes, xfce) I do have the issue that sometimes my log-in attempts are declined despite entering the password correctly.

There’s no caps lock issue because I remap caps-lock to control. Furthermore, I switched to the terminal via Alt-F1 and typed the password for testing purposes in the username field as well: all perfect.

While testing the text console, I found out that even there, I can’t log in. So it’s not just a xfce4 screenlocker issue.

After a while (I can’t say the duration follows a pattern) I can log in without an issue. So I need to wait and re-try every minute or so. That’s really annoying and a no-go for my business machine.

I’ve collected several outputs from “journalctl -d”: You have to ignore the USB messages as I was switching to a different host via my USB switcher, therefore it’s a bit messy.

The failed login attempts after resuming from hibernation start with 11:31:27. is much cleaner: lid closed, thus screen locked and shortly after unlock with bad luck.

12:49:46 lid was closed and opened (which locks the screen) and then login attempts were failing.

Both examples don’t seem to show any log message on positive login (at the end). is a NEGATIVE example: lid closing, screen lock and NO issue when entering password

My XDG_RUNTIME_DIR (mentioned on several pages like that) is set to “/run/user/1000”. So this seems to be OK.

Do you have any tips?

The screenlocker sounds similar to an issue I faced with swaylock, I had to add = { }; to my system config to give swaylock permission to check my password. I don’t know where I found that and maybe it isn’t so helpful to you anyway, just thought I’d throw it out there.

EDIT: in my case, I came across this thread which pointed out that there needs to be an /etc/pam.d/swaylock, which in NixOS we can achieve via = { };

Hi, thanks for the input.

However, if this would be the root cause, why am I able to log in after some (random) while?

Update: I had the issue yesterday and waited for half an hour notbeing able to log in. Sent the notebook to hibernate until today and still could not log in after waiting for another half an hour. Had to forcefully reboot. No cool. :frowning:

Yeah I guess your issue is more different than mine than I initially thought. Sorry I can’t be much more helpful.

It’s an official bug report now: Sometimes I can’t log in (to xfce screenlocker or shell) · Issue #256665 · NixOS/nixpkgs · GitHub