Score:5

Ubuntu 18.04 does not switch between users after upgrade

cn flag

I have upgraded Ubuntu 16.04 to Ubuntu 18.04. I do not intend to make a further upgrade to Ubuntu 20.xx for the moment. All looks to have gone well except the switching of users from within the desktop environment. My desktop environment was and is Unity.

There are two users in this computer. The expected behaviour is that within the desktop environment I can switch to any other profile without logging out of the current one, like in a multi-user system. In fact, I always have to log out from one profile to log into the other.

What's below happens always regardless of which profile is first.


1 Straight after the upgrade

1.1 Issue

The situation straight after the upgrade was:

  1. I log in into both desktop profiles separately: PASS.
  2. Once I am in either profile and click on the menu to access the other, nothing happens: FAIL.

So I stay where I am. I need to log out completely in order to access the other profile.

1.2 Partial fix

I followed the suggestion to reinstall the desktop environment with

sudo apt remove lightdm
sudo apt install lightdm
sudo reboot

This fixed the issue only partially.

  1. I can log in into either profile separately: PASS, OLD.
  2. If I click on the menu inside a profile to access any other profile, something happens: I am presented with the login screen with the password input: PASS, NEW.
  3. The resolution of the login screen where to input the password is rather coarse: FAIL, NEW.
  4. After I type in the password of the other profile, it hangs for several seconds before it loops back into the log-in screen.
    1. Therefore, I cannot access the other user profile: FAIL, NEW.
    2. However, I can log in back into the previous profile.

Other actions like

sudo apt install ubuntu-unity-desktop

or

sudo dpkg-reconfigure lightdm

have no effect or are redundant. Indeed, the same problem occurs regardless of whether the desktop environment is Unity or Ubuntu.


2 Current situation

2.1 Tests from the terminal

I can log in into both profiles from the terminal. After I am in the desktop environment of profile A, I move to a tty terminal and log in into profile B.

  1. At the first login, before the prompt the system message is

         Could not find key with description: [SIGNATURE]
         Could not find process_request_key_err in user session keyring for sig specified
         Error parsing option; rc = [-2]
    

    Both tests keyctl show and ls pass: so I CAN see the session keyring (the not-found message above is nonsense) and the directory content (the message above is immaterial).

  2. I exit and log in again. Before the prompt there is another message

         Signature not found in user keyring
         Perhaps try the interactive 'ecryptfs-mount-private'
    

    The test keyctl show fails (the not-found message above is consistent) and ls passes (the message above remains immaterial). Even if I try ecryptfs-mount-private, I load the key, the user switch problem persists, and these message occur again at the next reboot.

  3. Sometimes these messages do not show up at all (so, plain sailing within the terminal), but the problem of switching accounts in the desktop environment persists.

In the terminal I can see and browse the contents of the home directories. In all cases there is no blockage due to encryption.

2.2 From the desktop environment

  1. If I log out of the desktop environment of profile A and start afresh, the log-in screen with the password input is rendered neatly (no coarse resolution). I can log into profile B.
  2. When I try to switch from profile A to B and have left behind the desktop environment of profile A without logging out, I can always come back to profile A by typing the user password. That is: it goes in the way I would expect to work for activating profile B as well.
  3. If I create a new user C with administrator rights (a suggestion of @matigo), the following happens:
    1. I cannot switch from A and B to C precisely in the same way as I could not between A and B;
    2. I cannot log in the newly created C from the login screen either: the greeter screen returns to itself. The latter happens whether or not I have set a password for user C, so it's no human error.

2.3 Other posts

I have looked into these other posts, which refer to older releases of Ubuntu


3. Analysis of errors in journalctl

This follows up a suggestion of lemrm. This is my situation:

wmctrl -m
Name: Compiz
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF

echo $DESKTOP_SESSION 
unity

echo $GDMSESSION
unity

echo $XDG_CURRENT_DESKTOP
Unity:Unity7:ubuntu

3.1 Without libpam-kwallet*

The command journalctl -p err -b returns among others the following interesting lines on lightdm:

dec 10 21:33:59 computer lightdm[3992]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwalle
dec 10 21:33:59 computer lightdm[3992]: PAM adding faulty module: pam_kwallet.so
dec 10 21:33:59 computer lightdm[3992]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwall
dec 10 21:33:59 computer lightdm[3992]: PAM adding faulty module: pam_kwallet5.so
dec 10 21:33:59 computer lightdm[3992]: pam_unix(lightdm:auth): conversation failed
dec 10 21:33:59 computer lightdm[3992]: pam_unix(lightdm:auth): auth could not identify password for ...

I found these resources

The libraries pam_kwallet.so and pam_kwallet5.so belong to the packages

which are missing in my system. I do install them.

The interesting difference is that, when I move out to another profile via the menu, I do not splash again into the greeter with a choice of profiles, but in the "re-entry" page of the current profile (as though I had pressed Ctrl + L). I still need to log out to find a way into another profile. I can only come back to the profile I was in.

3.2 With libpam-kwallet*

The lines of journalctl -p err -b regarding lightdm become:

dec 10 22:16:23 computer lightdm[1766]: pam_kwallet(lightdm:session): pam_kwallet: Impossible to write walletKey to walletPipe
dec 10 22:16:23 computer lightdm[1767]: pam_kwallet5(lightdm:session): pam_kwallet5: Impossible to write walletKey to walletPipe

I have not found much on this Impossible to write walletKey to walletPipe that I could make use of:

  1. the source code: https://github.com/KDE/kwallet-pam/blob/master/pam_kwallet.c
  2. a complaint: https://forums.gentoo.org/viewtopic-p-8220820.html
  3. a bug report: https://bugs.launchpad.net/lightdm/+bug/1781418

3.3 pam_ecryptfs

After I try to change user from the menu, as per 3.1, the journal has appends one more line to the messages in 3.2

dec 10 23:28:11 computer compiz[2490]: pam_ecryptfs: seteuid error

after which I check that:

dpkg -S pam_ecryptfs
ecryptfs-utils: /usr/share/man/man8/pam_ecryptfs.8.gz
ecryptfs-utils: /lib/security/pam_ecryptfs.so

This shifts the focus from lightdm and kwallet to compiz and ecryptfs. These resources apply:


4. Question

Therefore, the problem seems to be purely one of managing the switch from any first current profile into any other profile inside the desktop environment.

Basically, I always have to log out from one profile to log into the other. So no multi-user behaviour.

Any suggestions to fix this?

in flag
If you create a new account (to test with), are you able to switch to that account successfully? I'm wondering if there is some cruft in the `/home` directory for the existing users that needs to be sorted out ...
XavierStuvw avatar
cn flag
@matigo Good point. If I create a new user C with administrator rights the following happens: 1) I cannot switch from A and B to C precisely in the same way as I could not between A and B; 2) **interestingly**, I cannot log in C either: the greeter screen returns to itself. The latter happens whether or not I have set a password for user C, so it's no human error. I have included this evidence in the post at 2.2.3.
Score:1
th flag

This behavior could be related to gnome-session <-> desktop environment <-> windowmanager

  1. Test the new account (C) with open new tty by ctrl+alt+F3, login with the given credentials and startx

  2. Check your error logs with journalctl -p err -b and maybe post at pastebin.

3. Check if something is missing by i.e. dpkg -l | grep '^ii' | grep gnome-s.

  1. Check your current environment by (see here)

    • Window manager: wmctrl -m
    • Session: echo $DESKTOP_SESSION
    • Desktop environment: echo $XDG_CURRENT_DESKTOP

    For me it is i.e. GNOME-Shell ubuntu-xorg ubuntu-GNOME, installed after dist-upgrade by install or reinstall

    sudo apt install gnome-session gnome-shell ubuntu-desktop-minimal

  2. Solve the ecryptfs issues, see this answer

  3. Option to remove compiz, see here (should work in the same way in 18.04)

  4. After this steps it's maybe helpful to do a sudo apt full-upgrade

XavierStuvw avatar
cn flag
Thanks for the suggestions.The actions on the windows environment and session did not bring any useful change. However, the analysis of `journalctl` has highlighted that `lightdm` has issues with the `kwallet` tool. This is possibly a dormant bug. I have added the new evidence in the question, in a new Section 3.
lemrm avatar
th flag
Is `kwallet` `kde`? Why mixing `gnome` and `kde`? There is `seahorse` at `gnome`.
XavierStuvw avatar
cn flag
Dunno. If you think this is critical and have a plan for a solution, I will more than happy to try that path. I "have 10 hours to award this bounty to an eligible answer" BTW
lemrm avatar
th flag
...maybe this solution ( https://askubuntu.com/questions/79636/how-to-remove-all-traces-of-kde-installed ) and have you thought about migrating your profile to a new created one?
lemrm avatar
th flag
... maybe try to start from a new created admin user and be aware to have all users in the same desktop environment.
XavierStuvw avatar
cn flag
If I create a new profile, I cannot even log in into it (see Sec 2.2.3); migration sounds like a shot in the dark and even like asking for troubles. If memory serves me well, I have never installed kubuntu or the like which might have affected the desktop environment; `dpkg -l | grep -i kub` returns zero matches anyhow. The issue occurs regardless of whether I use a gdm or unity desktop environment (Sec 1.2). Thanks for sparring, appreciated. I will see if new answers come up.
lemrm avatar
th flag
I have improved the answer at (1.). Is this possible?
lemrm avatar
th flag
If so, please, continue with the next steps. Maybe remove `kwallet` install `seahorse` and do the `sudo apt full-upgrade`
lemrm avatar
th flag
Also maybe remove `compiz` and replace it for instance with `gnome-shell`
lemrm avatar
th flag
This was my problem with `18.04` to upgrade to 21.10 . Because would not be fixed in `18.04` -> https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1820859
XavierStuvw avatar
cn flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/132244/discussion-between-xavierstuvw-and-lemrm).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.