Bug 477073

Summary: cannot login to Wayland session
Product: [Plasma] plasmashell Reporter: Piotr Mierzwinski <piotr.mierzwinski>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: fanzhuyifan, kde, piotr.mierzwinski
Priority: NOR Keywords: qt6, wayland-only
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: plasma.desktop
journalctl -b
journalctl_-b_plasma-updated-24112023

Description Piotr Mierzwinski 2023-11-16 02:53:26 UTC
SUMMARY
As in subject. Instead of this I get login screen, which also I cannot change (after enter password it returns to old one).
Additionally I cannot set automatically login with Wayland session in System Settings. When I open "Login screen (SDDM( -> Behavior "  I can see set session "Plasma (X11)", but I use Wayland. 
After I change to Wayland and enter the password it switches (in combobox) to Plasma (X11) again.

I had this have set several months ago and recently stopped work.


STEPS TO REPRODUCE
1. Start System Settings
2. Login screen (SDDM( -> Behavior 
3. Set session Wayland
4. Press Apply

OBSERVED RESULT
In result of start Plasma I can see login screen.
Switch to Wayland doesn't work in System Settings.

EXPECTED RESULT
Should be able to automatically login with Wayland session, as it happens some time ago.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.81
KDE Frameworks Version: 5.245
Qt Version: 6.6

ADDITIONAL INFORMATION
Comment 1 fanzhuyifan 2023-11-16 03:46:26 UTC
Based on your description, it seems that you cannot log into the plasma session at all. Is that what is happening?
If so, can you log into the plasma session with the latest neon unstable iso?
Comment 2 Piotr Mierzwinski 2023-11-19 02:10:53 UTC
(In reply to fanzhuyifan from comment #1)
> Based on your description, it seems that you cannot log into the plasma
> session at all. Is that what is happening?
> If so, can you log into the plasma session with the latest neon unstable iso?

As I said I get default login screen. 
Completing the information. Here I can select Wayland and login into it. The issue is that autologin to Wayland session configured long time ago stopped work. BTW. I did it manually in sddm config file and long time was working well.
Second problem is that in System Setting is not possible to set session Wayland for autologin - after apply always back to Plasma (X11).
Neon Unstable I installed, more or less when started development Plasma 6, and I try to update it daily.

Maybe this is the problem latest version of sddm?
$ apt list sddm -a
Listing... Done
sddm/jammy,now 0.20.0+p22.04+vunstable+git20231114.0056-0 amd64 [installed,automatic]
sddm/jammy-updates 0.19.0-2ubuntu2.3 amd64
sddm/jammy 0.19.0-2ubuntu2 amd64

In /usr/lib/sddm/sddm.conf.d I have such such configuration:
- file: 00neon-reuse.conf
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>

[Users]
ReuseSession=true

- file: 00neon-theme.conf
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2020 Jonathan Riddell <jr@jriddell.org>

[Theme]
Current=breeze

BTW. Seems that theme breeze is not chosen at all.

Anyway I added following into file: 00neon-reuse.conf
Comment 3 Piotr Mierzwinski 2023-11-19 02:17:03 UTC
Anyway I added following configuration into file: "00neon-reuse.conf"
<cut>
[Autologin]
User=piotr
Session=plasmawayland

[Wayland]
CompositorCommand=kwin_wayland --no-lockscreen
</cut>
I will update this post soon to let you know it this helped.

I think I will report another issue that configuration of sddm - part calling: "Login Screen (SDDM)" doesn't work in System Settings. Neither change of login screen nor configuration.
Comment 4 Piotr Mierzwinski 2023-11-19 04:13:42 UTC
Seems above broke login screen. And I could not even enter the password.
Putting following seems doesn't break it:
<cut>
[Autologin]
User=piotr"
</cut>
Comment 5 fanzhuyifan 2023-11-20 22:23:30 UTC
(In reply to Piotr Mierzwinski from comment #3)
> Anyway I added following configuration into file: "00neon-reuse.conf"
> <cut>
> [Autologin]
> User=piotr
> Session=plasmawayland
> 
> [Wayland]
> CompositorCommand=kwin_wayland --no-lockscreen
> </cut>
> I will update this post soon to let you know it this helped.
> 
> I think I will report another issue that configuration of sddm - part
> calling: "Login Screen (SDDM)" doesn't work in System Settings. Neither
> change of login screen nor configuration.

The wayland session has been renamed to just plasma, instead of plasmawayland. Could you try that to see if it works?

Also, would you be able to provide your full sddm configurations?
Comment 6 Piotr Mierzwinski 2023-11-23 00:18:27 UTC
(In reply to fanzhuyifan from comment #5)
> (In reply to Piotr Mierzwinski from comment #3)
> > Anyway I added following configuration into file: "00neon-reuse.conf"
> > <cut>
> > [Autologin]
> > User=piotr
> > Session=plasmawayland
> > 
> > [Wayland]
> > CompositorCommand=kwin_wayland --no-lockscreen
> > </cut>
> > I will update this post soon to let you know it this helped.
> > 
> > I think I will report another issue that configuration of sddm - part
> > calling: "Login Screen (SDDM)" doesn't work in System Settings. Neither
> > change of login screen nor configuration.
> 
> The wayland session has been renamed to just plasma, instead of
> plasmawayland. Could you try that to see if it works?
OK. Let me check. I updated my configuration as you suggested. I will update this post, soon.
 
> Also, would you be able to provide your full sddm configurations?
I'm not sure if this is what you needed, but check out below. And if this is not enough, tell me please where I can find more.

$ pwd
/usr/lib/sddm/sddm.conf.d

$ cat 00neon-autologin.conf 00neon-reuse.conf 00neon-theme.conf 
[Autologin]
User=piotr
Session=plasma

# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>

[Users]
ReuseSession=true

# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2020 Jonathan Riddell <jr@jriddell.org>

[Theme]
Current=Breeze


$ pwd
/var/lib/sddm

$ cat state.conf 
[Last]
# Name of the last logged-in user.
# This user will be preselected when the login screen appears
User=piotr


# Name of the session for the last logged-in user.
# This session will be preselected when the login screen appears.
Session=/usr/share/wayland-sessions/plasma.desktop
Comment 7 Piotr Mierzwinski 2023-11-23 00:31:27 UTC
Using above configuration I get login screen.

And this is not Breeze stated in configuration, only one I set long time ago, and which actually doesn't work because it was dedicated for Plasma 5. It looks similar like one in post here (OpenMandriva forum): https://forum.openmandriva.org/t/sddm-login-screen-incorrect-after-upgrading-to-rome/4972 . Maybe this topic for another bug report.
Comment 8 fanzhuyifan 2023-11-23 00:43:20 UTC
(In reply to Piotr Mierzwinski from comment #7)
> Using above configuration I get login screen.
> 
> And this is not Breeze stated in configuration, only one I set long time
> ago, and which actually doesn't work because it was dedicated for Plasma 5.
> It looks similar like one in post here (OpenMandriva forum):
> https://forum.openmandriva.org/t/sddm-login-screen-incorrect-after-upgrading-
> to-rome/4972 . Maybe this topic for another bug report.

So you are not automatically logged in as expected, right?

Could you try just keeping this:

[Autologin]
User=piotr
Session=plasma

and deleting everything else in your sddm configs and see if it automatically logs you in?

Also, could you manually select the wayland session and log in?
Comment 9 fanzhuyifan 2023-11-23 00:44:49 UTC
(In reply to Piotr Mierzwinski from comment #7)
> Using above configuration I get login screen.
> 
> And this is not Breeze stated in configuration, only one I set long time
> ago, and which actually doesn't work because it was dedicated for Plasma 5.
> It looks similar like one in post here (OpenMandriva forum):
> https://forum.openmandriva.org/t/sddm-login-screen-incorrect-after-upgrading-
> to-rome/4972 . Maybe this topic for another bug report.

What is the output of "ls /usr/share/wayland-sessions/"?
Comment 10 Piotr Mierzwinski 2023-11-23 17:10:00 UTC
(In reply to fanzhuyifan from comment #9)
> (In reply to Piotr Mierzwinski from comment #7)
> > Using above configuration I get login screen.
> > 
> > And this is not Breeze stated in configuration, only one I set long time
> > ago, and which actually doesn't work because it was dedicated for Plasma 5.
> > It looks similar like one in post here (OpenMandriva forum):
> > https://forum.openmandriva.org/t/sddm-login-screen-incorrect-after-upgrading-
> > to-rome/4972 . Maybe this topic for another bug report.
> 
> What is the output of "ls /usr/share/wayland-sessions/"?

$ ls /usr/share/wayland-sessions/
plasma.desktop
Comment 11 Piotr Mierzwinski 2023-11-23 17:11:09 UTC
Created attachment 163403 [details]
plasma.desktop
Comment 12 Piotr Mierzwinski 2023-11-23 17:12:38 UTC
Recently sddm was updated, so:
$ apt list sddm -a
Listing... Done
sddm/jammy,now 0.20.0+p22.04+vunstable+git20231120.0949-0 amd64 [installed,automatic]
sddm/jammy-updates 0.19.0-2ubuntu2.3 amd64
sddm/jammy 0.19.0-2ubuntu2 amd64
Comment 13 fanzhuyifan 2023-11-23 17:27:28 UTC
> Could you try just keeping this:
> 
> [Autologin]
> User=piotr
> Session=plasma
> 
> and deleting everything else in your sddm configs and see if it
> automatically logs you in?

Have you tried this? 

Also, when the automatic login did not happen, could you switch to a tty (ctrl-alt-4) and report the output of journalctl -b ?
Comment 14 fanzhuyifan 2023-11-23 17:28:32 UTC
Sorry I meant ctrl-alt-f4; use ctrl-alt-f1/2 to switch back
Comment 15 Piotr Mierzwinski 2023-11-25 04:04:48 UTC
Recently sddm was updated, so:
$ apt list sddm -a
Listing... Done
sddm/jammy,now 0.20.0+p22.04+vunstable+git20231120.0949-0 amd64 [installed,automatic]
sddm/jammy-updates 0.19.0-2ubuntu2.3 amd64
sddm/jammy 0.19.0-2ubuntu2 amd64
(In reply to fanzhuyifan from comment #13)
> > Could you try just keeping this:
> > 
> > [Autologin]
> > User=piotr
> > Session=plasma
> > 
> > and deleting everything else in your sddm configs and see if it
> > automatically logs you in?
> 
> Have you tried this? 
Had no tried. Only I removed almost all from directory /var/lib/sddm. I left only file "state.conf". Of course didn't help.
I will provide update soon.

> Also, when the automatic login did not happen, could you switch to a tty
> (ctrl-alt-4) and report the output of journalctl -b ?
Please find in attachment. BTW. In this case I could not login to Plasma Wayland even by login screen. Every time it had back to login screen.
Comment 16 Piotr Mierzwinski 2023-11-25 04:05:17 UTC
Created attachment 163448 [details]
journalctl -b
Comment 17 Piotr Mierzwinski 2023-11-25 04:26:22 UTC
Created attachment 163449 [details]
journalctl_-b_plasma-updated-24112023
Comment 18 Piotr Mierzwinski 2023-11-25 04:30:27 UTC
Autologin still doesn't work. I'm not sure if this is because I could not login to Plasma by login screen.
I updated Plasma at 24/11/2023 and still could login to Plasma by login screen. I made test after this update.
Additionally I left only suggested configuration, so:

$ pwd
/usr/lib/sddm/sddm.conf.d
$ ls -l
total 4
-rw-r--r-- 1 root root 38 lis 23 01:11 00neon-autologin.conf
$ cat 00neon-autologin.conf 
[Autologin]
User=piotr
Session=plasma
Comment 19 fanzhuyifan 2023-11-25 06:05:16 UTC
> lis 25 00:35:10 Dell sddm[1143]: Display server started.
> lis 25 00:35:10 Dell sddm[1143]: Unable to find autologin session entry "plasmawayland"
> lis 25 00:35:10 Dell sddm[1143]: Autologin failed!
> lis 25 00:35:10 Dell sddm[1143]: Socket server starting...
> lis 25 00:35:10 Dell sddm[1143]: Socket server started.
> lis 25 00:35:10 Dell sddm[1143]: Loading theme configuration from "/usr/share/sddm/themes/Gently-Blur/theme.conf"

Looking at the logs, it seems that you still have got plasmawayland instead of plasma configured for autologin...
So I am tempted to close this as this seems like a configuration issue..
Comment 20 Piotr Mierzwinski 2023-11-26 00:54:48 UTC
(In reply to fanzhuyifan from comment #19)
> > lis 25 00:35:10 Dell sddm[1143]: Display server started.
> > lis 25 00:35:10 Dell sddm[1143]: Unable to find autologin session entry "plasmawayland"
> > lis 25 00:35:10 Dell sddm[1143]: Autologin failed!
> > lis 25 00:35:10 Dell sddm[1143]: Socket server starting...
> > lis 25 00:35:10 Dell sddm[1143]: Socket server started.
> > lis 25 00:35:10 Dell sddm[1143]: Loading theme configuration from "/usr/share/sddm/themes/Gently-Blur/theme.conf"
> 
> Looking at the logs, it seems that you still have got plasmawayland instead
> of plasma configured for autologin...
> So I am tempted to close this as this seems like a configuration issue..

I provided you my configuration, and cleaned it you as you suggested, but without effect.
Anyway I found another files:
<cut>
$ cat /etc/sddm.conf.d/kde_settings.conf
[Autologin]
Relogin=false
Session=plasma
User=piotr

[General]
HaltCommand=
RebootCommand=

[Theme]
Current=breeze
CursorSize=
CursorTheme=breeze_cursors
Font=Noto Sans,10,-1,0,400,0,0,0,0,0,0,0,0,0,0,1

[Users]
MaximumUid=60000
MinimumUid=1000

[X11]
ServerArguments=-dpi 0

</cut>

File ⁄etc⁄sddm.conf.txt  is empty
Comment 21 Piotr Mierzwinski 2023-11-26 01:02:51 UTC
Today magically autologin started work.
One thing I have done was cleaning directory /etc/sddm.conf.d where was placed couple files, so:

$ ls -l
total 20
-rw-r--r-- 1 piotr piotr 275 nov 20 19:09 kde_settings.conf
-rw-r--r-- 1 root  root  161 may 25  2023 kde_settings.conf.bak
-rw-r--r-- 1 root  root  169 nov  6 00:24 kde_settings.conf.last-ok
-rw-r--r-- 1 piotr piotr 306 may 25  2023 kde_settings.conf.new
-rw-r--r-- 1 root  root  309 may 26  2023 kde_settings.conf.wayland_autologin

I left only kde_settings.conf. I made update and turned off my PC. Late evening turned on and turned out that I was able to login without password. Even login screen changed to the "breeze".

I don't know if this was result my cleaning or update helped. Anyway I'm going to close this bug report.
Comment 22 fanzhuyifan 2023-11-26 01:37:05 UTC
(In reply to Piotr Mierzwinski from comment #21)
> Today magically autologin started work.
> One thing I have done was cleaning directory /etc/sddm.conf.d where was
> placed couple files, so:
> 
> $ ls -l
> total 20
> -rw-r--r-- 1 piotr piotr 275 nov 20 19:09 kde_settings.conf
> -rw-r--r-- 1 root  root  161 may 25  2023 kde_settings.conf.bak
> -rw-r--r-- 1 root  root  169 nov  6 00:24 kde_settings.conf.last-ok
> -rw-r--r-- 1 piotr piotr 306 may 25  2023 kde_settings.conf.new
> -rw-r--r-- 1 root  root  309 may 26  2023 kde_settings.conf.wayland_autologin
> 
> I left only kde_settings.conf. I made update and turned off my PC. Late
> evening turned on and turned out that I was able to login without password.
> Even login screen changed to the "breeze".
> 
> I don't know if this was result my cleaning or update helped. Anyway I'm
> going to close this bug report.

With very probability I think it was the result of cleaning the config folder...
I am glad you solved the issue!
Comment 23 fanzhuyifan 2023-11-26 06:33:58 UTC
By the way I checked `man sddm.conf`, and they were using all the files in /etc/sddm.conf.d !

> SYNOPSIS
>        Configuration  loads  all  files  in  the configuration directories followed by the configuration file in the order listed below with the latter having highest
>        precedence. Changes should be made to the local configurations.
> 
>        /usr/lib/sddm/sddm.conf.d
>               System configuration directory
> 
>        /etc/sddm.conf.d
>               Local configuration directory
> 
>        /etc/sddm.conf
>               Local configuration file for compatibility
>