Bug 429314 - The first time you open the Users KCM after boot, it has no content
Summary: The first time you open the Users KCM after boot, it has no content
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_users (show other bugs)
Version: 5.20.3
Platform: Other Linux
: VHI normal (vote)
Target Milestone: ---
Assignee: Janet Blackquill
URL: https://gitlab.freedesktop.org/accoun...
Keywords: regression
: 429897 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-18 17:04 UTC by dS810
Modified: 2020-12-02 15:13 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20.5


Attachments
Screenshot 1 (85.73 KB, image/png)
2020-11-18 17:04 UTC, dS810
Details
access in terminal kcmshell5 kcm_users (470.82 KB, image/png)
2020-12-01 20:05 UTC, yurifontella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dS810 2020-11-18 17:04:57 UTC
Created attachment 133440 [details]
Screenshot 1

SUMMARY


STEPS TO REPRODUCE
1. Press Meta/Windows key
2. Enter Users and press enter

>> See Screenshot

Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.1
Kernel Version: 5.9.8-arch1-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6300U CPU @ 2.40GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Comment 1 Nate Graham 2020-11-18 21:46:03 UTC
Weird, works for me.
Comment 2 Justin Zobel 2020-11-19 03:17:02 UTC
What is the version of systemsettings you are using? You can get the version number from the three - lines in the top right and clicking About System Settings.
Comment 3 dS810 2020-11-19 07:39:44 UTC
(In reply to Justin Zobel from comment #2)
> What is the version of systemsettings you are using? You can get the version
> number from the three - lines in the top right and clicking About System
> Settings.

Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.1
Kernel Version: 5.9.8-arch1-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6300U CPU @ 2.40GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Comment 4 dS810 2020-11-19 07:40:56 UTC
I tested it right now again - same issue
Comment 5 Justin Zobel 2020-11-19 07:58:39 UTC
Thanks, I can't confirm the same issue here on openSUSE Tumbleweed, 5.20.3.

Can you please test on a fresh user to make sure it's not a config related issue?
Comment 6 Antonio Rojas 2020-11-19 07:58:58 UTC
This seems to be a race condition with accountsservice. For me, it ony happens the first time I launch it after boot. All subsequent runs work fine. If I kill accounts-daemon, then I can reproduce it again (only the first time, again).
Comment 7 Justin Zobel 2020-11-19 08:05:21 UTC
Confirmed. Antonio's comment allows me to reproduce this issue.
Comment 8 Nate Graham 2020-11-19 14:58:11 UTC
Ugh, the first time you open it after boot is exactly the case that most users will hit. :(
Comment 9 Janet Blackquill 2020-11-20 00:08:05 UTC
dS810, per chance, are you not using a display manager such as SDDM or GDM? The accounts service generally expects that a display manager interacts with it for stuff like locale, so it being dead when you're in a user session isn't really part of its expected flow of events.

Either way, it failing to have a sane state on DBus activation is most likely an upstream bug, so I filed an issue there.

https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/93

Marking this as resolved upstream for now.

If there's anything that can be done downstream to work around this, please reopen this bug.
Comment 10 dS810 2020-11-20 10:08:24 UTC
(In reply to Jan Blackquill (Carson Black) from comment #9)
Hello Jan,

I use SDDM.
Comment 11 Antonio Rojas 2020-11-20 10:27:33 UTC
(In reply to Jan Blackquill (Carson Black) from comment #9)
> dS810, per chance, are you not using a display manager such as SDDM or GDM?
> The accounts service generally expects that a display manager interacts with
> it for stuff like locale, so it being dead when you're in a user session
> isn't really part of its expected flow of events.

I don't think SDDM interacts with accountsservice in any way, other than to retrieve avatars from accoutsservice's path (which doesn't need the accounts daemon to be running at all)

sddm > git grep Accounts
ChangeLog:    + Make greeter see icons set by AccountsServices.
src/greeter/UserModel.cpp:                QString accountsServiceFace = QStringLiteral("/var/lib/AccountsService/icons/%1").arg(user->name);
Comment 12 Nate Graham 2020-12-01 19:41:31 UTC
*** Bug 429897 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2020-12-01 19:42:10 UTC
is there nothing we can do to work around this locally? It's a pretty bad bug.
Comment 14 yurifontella 2020-12-01 20:05:28 UTC
Created attachment 133787 [details]
access in terminal kcmshell5 kcm_users
Comment 15 David Edmundson 2020-12-02 00:10:47 UTC
I ran in bustle, reproduced the issue and captured a DBus traffic log.
AccountsService looked correct in that.

I'm not convinced we understand the initial problem.
Comment 16 David Edmundson 2020-12-02 00:15:16 UTC
Found it! 

It is a race, it is entirely our side. Will fix.
Comment 17 Bug Janitor Service 2020-12-02 00:25:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/250
Comment 18 David Edmundson 2020-12-02 00:26:14 UTC
@Jan can you close the upstream bug report please.
Comment 19 David Edmundson 2020-12-02 10:06:10 UTC
Git commit 987cafc23638d59bc4e15a964931a04fe30aa988 by David Edmundson.
Committed on 02/12/2020 at 10:05.
Pushed by davidedmundson into branch 'master'.

[kcms/users] Avoid race condition on startup

If accounts service is not yet running the name will not be registered
when we make our first call.

We call into AccountsService from our client code with a blocking call.
We then create a new QDBusAbstractInterface on a given service.

QDBusAbstractInterface::isValid effectively is just a check that the
service is registered. This might not be processed yet at the time we
call this. It isn't a helpful check, if it wasn't up the previous call
to fetch users would have failed. We can just remove it.

M  +1    -1    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/987cafc23638d59bc4e15a964931a04fe30aa988
Comment 20 David Edmundson 2020-12-02 10:06:45 UTC
Git commit 036fd9d18cef1d33f330ae91b9b272089493caa3 by David Edmundson.
Committed on 02/12/2020 at 10:06.
Pushed by davidedmundson into branch 'Plasma/5.20'.

[kcms/users] Avoid race condition on startup

If accounts service is not yet running the name will not be registered
when we make our first call.

We call into AccountsService from our client code with a blocking call.
We then create a new QDBusAbstractInterface on a given service.

QDBusAbstractInterface::isValid effectively is just a check that the
service is registered. This might not be processed yet at the time we
call this. It isn't a helpful check, if it wasn't up the previous call
to fetch users would have failed. We can just remove it.


(cherry picked from commit 987cafc23638d59bc4e15a964931a04fe30aa988)

M  +1    -1    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/036fd9d18cef1d33f330ae91b9b272089493caa3