Screen not locking after waking up from suspend

Hello, i have a problem with screen locker. Sometimes after closing laptop lid and then opening it again screen locker does not appear. After it i can lock it manually with Meta+L. Journalctl shows that kscreenlocker is unable to establish screen lock. Unfortunately my technical expertise ends about here, so where else can i look? This problem also existed on xubuntu distro, so maybe its hardware? Latest updates are installed. Thank you.

System:
  Kernel: 5.8.6-1-MANJARO x86_64 bits: 64 compiler: N/A 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 
  root=UUID=116713ee-9163-4142-8a6a-90f9278537f2 rw quiet apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: KDE Plasma 5.19.5 tk: Qt 5.15.0 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: ASUSTeK product: S300CA v: 1.0 serial: <filter> 
  Mobo: ASUSTeK model: S300CA v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: S300CA.305 date: 07/04/2013 
Battery:
  ID-1: BAT0 charge: 32.2 Wh condition: 32.5/45.3 Wh (72%) volts: 11.2/11.2 
  model: ASUSTeK X402--40 type: Li-ion serial: N/A status: Unknown cycles: 450 
CPU:
  Topology: Dual Core model: Intel Core i5-3317U bits: 64 type: MT MCP 
  arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 
  L2 cache: 3072 KiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 13575 
  Speed: 817 MHz min/max: 800/2600 MHz Core speeds (MHz): 1: 817 2: 802 3: 829 
  4: 801 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics vendor: ASUSTeK driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:0166 
  Device-2: IMC Networks type: USB driver: uvcvideo bus ID: 1-1.2:4 
  chip ID: 13d3:5195 serial: <filter> 
  Display: x11 server: X.Org 1.20.8 compositor: kwin_x11 driver: intel 
  unloaded: modesetting alternate: fbdev,vesa display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
  s-diag: 414mm (16.3") 
  Monitor-1: LVDS1 res: 1366x768 hz: 60 dpi: 120 size: 290x160mm (11.4x6.3") 
  diag: 331mm (13") 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) 
  v: 4.2 Mesa 20.1.7 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: ASUSTeK 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1e20 
  Sound Server: ALSA v: k5.8.6-1-MANJARO 
Network:
  Device-1: Qualcomm Atheros AR9485 Wireless Network Adapter vendor: AzureWave 
  driver: ath9k v: kernel port: f040 bus ID: 02:00.0 chip ID: 168c:0032 
  IF: wlp2s0 state: up mac: <filter> 
  Device-2: Qualcomm Atheros AR8161 Gigabit Ethernet vendor: ASUSTeK 
  driver: alx v: kernel port: e000 bus ID: 03:00.0 chip ID: 1969:1091 
  IF: enp3s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 298.09 GiB used: 152.26 GiB (51.1%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/sda vendor: Hitachi model: HTS543232A7A384 size: 298.09 GiB 
  block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  rotation: 5400 rpm serial: <filter> rev: A60W scheme: GPT 
Partition:
  ID-1: / raw size: 97.66 GiB size: 95.62 GiB (97.92%) used: 21.27 GiB (22.2%) 
  fs: ext4 dev: /dev/sda2 
  ID-2: /home raw size: 191.92 GiB size: 187.91 GiB (97.91%) 
  used: 130.99 GiB (69.7%) fs: ext4 dev: /dev/sda4 
Swap:
  Kernel: swappiness: 10 (default 60) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 8.21 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 49.0 C mobo: N/A 
  Fan Speeds (RPM): cpu: 2200 
Info:
  Processes: 190 Uptime: 1h 20m Memory: 3.73 GiB used: 1.85 GiB (49.6%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 clang: 10.0.1 Packages: 
  pacman: 1354 lib: 364 flatpak: 0 Shell: Bash v: 5.0.18 running in: yakuake 
  inxi: 3.1.05 
[emile@emile-s300ca ~]$ journalctl --since "2020-09-10 00:10:40" --until "2020-09-10 00:10:50"
-- Logs begin at Fri 2020-07-24 02:45:18 MSK, end at Thu 2020-09-10 01:12:59 MSK. --
сен 10 00:10:42 emile-s300ca systemd-logind[823]: Lid closed.
сен 10 00:10:42 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1)))
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, t>
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Starting Login1 suspend job
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Pausing all media players before sleep
сен 10 00:10:43 emile-s300ca kded5[1291]: bluedevil: About to suspend
сен 10 00:10:43 emile-s300ca ModemManager[933]: <info>  [sleep-monitor] system is about to suspend
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.2414] manager: sleep: sleep requested (sleeping: no  enabled: yes)
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.2414] device (enp3s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-stat>
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.2462] device (p2p-dev-wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-i>
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.2476] manager: NetworkManager state is now ASLEEP
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.2488] device (wlp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-sta>
сен 10 00:10:43 emile-s300ca kded5[1291]: plasma-nm: Unhandled active connection state change:  3
сен 10 00:10:43 emile-s300ca dbus-daemon[817]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.>
сен 10 00:10:43 emile-s300ca systemd[1]: Starting Network Manager Script Dispatcher Service...
сен 10 00:10:43 emile-s300ca ksmserver[1318]: kscreenlocker: Could not establish screen lock
сен 10 00:10:43 emile-s300ca kernel: audit: type=1130 audit(1599685843.282:153): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=NetworkManager->
сен 10 00:10:43 emile-s300ca kernel: wlp2s0: deauthenticating from f8:df:a8:77:ab:b4 by local choice (Reason: 3=DEAUTH_LEAVING)
сен 10 00:10:43 emile-s300ca audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=NetworkManager-dispatcher comm="systemd" ex>
сен 10 00:10:43 emile-s300ca systemd[1]: Started Network Manager Script Dispatcher Service.
сен 10 00:10:43 emile-s300ca dbus-daemon[817]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7464] device (wlp2s0): supplicant interface state: completed -> disconnected
сен 10 00:10:43 emile-s300ca wpa_supplicant[869]: wlp2s0: CTRL-EVENT-DISCONNECTED bssid=f8:df:a8:77:ab:b4 reason=3 locally_generated=1
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7466] device (wlp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface->
сен 10 00:10:43 emile-s300ca wpa_supplicant[869]: wlp2s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7608] dhcp4 (wlp2s0): canceled DHCP transaction
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Withdrawing address record for fe80::8cfd:3ffb:2f72:e6ca on wlp2s0.
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7609] dhcp4 (wlp2s0): state changed bound -> done
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Leaving mDNS multicast group on interface wlp2s0.IPv6 with address fe80::8cfd:3ffb:2f72:e6ca.
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7730] device (wlp2s0): set-hw-addr: set MAC address to 92:89:31:81:12:1E (scanning)
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Interface wlp2s0.IPv6 no longer relevant for mDNS.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Interface wlp2s0.IPv4 no longer relevant for mDNS.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Leaving mDNS multicast group on interface wlp2s0.IPv4 with address 192.168.0.127.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Withdrawing address record for 192.168.0.127 on wlp2s0.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Joining mDNS multicast group on interface wlp2s0.IPv4 with address 192.168.0.127.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: New relevant interface wlp2s0.IPv4 for mDNS.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Registering new address record for 192.168.0.127 on wlp2s0.IPv4.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Withdrawing address record for 192.168.0.127 on wlp2s0.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Leaving mDNS multicast group on interface wlp2s0.IPv4 with address 192.168.0.127.
сен 10 00:10:43 emile-s300ca avahi-daemon[814]: Interface wlp2s0.IPv4 no longer relevant for mDNS.
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7978] device (wlp2s0): supplicant interface state: disconnected -> interface_disabled
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.7979] device (wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-sta>
сен 10 00:10:43 emile-s300ca NetworkManager[818]: <info>  [1599685843.8085] device (wlp2s0): set-hw-addr: reset MAC address to 6C:71:D9:50:4D:D5 (unmanage)
сен 10 00:10:43 emile-s300ca kded5[1291]: plasma-nm: Not emitting connection deactivated notification as we're about to suspend
сен 10 00:10:43 emile-s300ca wpa_supplicant[869]: nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
сен 10 00:10:48 emile-s300ca systemd-logind[823]: Delay lock is active (UID 1000/emile, PID 1318/ksmserver) but inhibitor timeout is reached.
сен 10 00:10:48 emile-s300ca systemd[1]: Reached target Sleep.
сен 10 00:10:48 emile-s300ca systemd[1]: Starting Suspend...
сен 10 00:10:48 emile-s300ca systemd-sleep[24884]: Suspending system...
сен 10 00:10:48 emile-s300ca kernel: PM: suspend entry (deep)
lines 13-51/51 (END)

Can you run:

cat /etc/systemd/logind.conf

And paste the output here.

Also, look at your power management settings.

Sleep on laptop lid is enabled, lock after waking up is enabled in screen locking settings, anything i miss?

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Two things I noticed and I am looking further into:

сен 10 00:10:42 emile-s300ca systemd-logind[823]: Lid closed.
сен 10 00:10:42 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1)))
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, t>
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Starting Login1 suspend job
сен 10 00:10:43 emile-s300ca org_kde_powerdevil[1424]: powerdevil: Pausing all media players before sleep
сен 10 00:10:43 emile-s300ca kded5[1291]: bluedevil: About to suspend

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This says that org_kde_powerdevil is suspending the system because the lid was closed.

сен 10 00:10:43 emile-s300ca ksmserver[1318]: kscreenlocker: Could not establish screen lock

Seems like that would cause ^^ This ^^

Does the issue happen with different kernel versions?

It happened with 5.7 kernel, i switched to 5.8 with latest update

Do you have a /etc/pam.d/

If so, can you ls in that folder and paste the contents here?

[emile@emile-s300ca ~]$ cd /etc/pam.d
[emile@emile-s300ca pam.d]$ ls
chage      chpasswd  cups      groupmems  login     passwd    rsh        samba           sddm-greeter  su    system-auth         system-login         useradd  vlock
chfn       chsh      groupadd  groupmod   newusers  polkit-1  runuser    sddm            shadow        sudo  systemd-user        system-remote-login  userdel
chgpasswd  crond     groupdel  kde        other     rlogin    runuser-l  sddm-autologin  sshd          su-l  system-local-login  system-services      usermod