Lost supplementary user groups for GUI login session

Ubuntu 16.04.5

Very weird situation - after Xorg crash, now every time when I login into Unity, my user account doesn't have it's system groups like adm, sudo, plugdev, fuse etc. But when I login on virtual console (Alt+F1) or over SSH - all my additional groups are there, as reported by id command.

Neither of /etc/group* or /etc/gshadow* files have changed, my user is still listed there in many system groups.

It looks like some systemd session parameters for GUI logins or lightdm cache files got screwed. But I have no idea where to start looking..

A lightdm log:

$ journalctl -au lightdm

-- Reboot --
systemd[1]: Starting Light Display Manager...
systemd[1]: Started Light Display Manager.
lightdm[3223]: pam_kwallet5(lightdm-greeter:setcred): (null): pam_sm_setcred
lightdm[3223]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
lightdm[3345]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "chm"
lightdm[4867]: pam_ecryptfs: Passphrase file wrapped
lightdm[3345]: pam_kwallet5(lightdm:auth): (null): pam_sm_authenticate
lightdm[3345]: pam_kwallet5(lightdm:setcred): pam_kwallet5: pam_sm_setcred
lightdm[3345]: pam_unix(lightdm:session): session opened for user chm by (uid=0)
lightdm[3046]: Error writing to daemon: Bad file descriptor
lightdm[3046]: Error writing to daemon: Bad file descriptor
lightdm[3046]: Error writing to daemon: Bad file descriptor
lightdm[3046]: Failed to write utmpx: Permission denied

This seems to be a lightdm / kwallet bug, see here: https://bugs.launchpad.net/lightdm/+bug/1781418 and here: https://bugzilla.redhat.com/show_bug.cgi?id=1581495

Commenting out

auth optional pam_kwallet.so
auth optional pam_kwallet5.so

to

#auth optional pam_kwallet.so
#auth optional pam_kwallet5.so

in /etc/pam.d/lightdm - as suggested in the link above, solves the problem for now.