Bug 514104

Summary: KWallet asks to create a new wallet if the wallet password prompt is ignored
Product: [Frameworks and Libraries] frameworks-kwallet Reporter: Alexander Puchmayr <alexander.puchmayr>
Component: generalAssignee: Valentin Rusu <valir>
Status: REPORTED ---    
Severity: major CC: alexander.puchmayr, florian-evers, kdelibs-bugs-null, mk.mateng, notmart
Priority: NOR    
Version First Reported In: 6.20.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=514189
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alexander Puchmayr 2026-01-03 10:33:03 UTC
SUMMARY
When kwallet's password dialog times out, service is not usable. No second chance until re-login.

STEPS TO REPRODUCE
1. Login to plasma. 
2. open a service needing the kwallet master password, e.g. the WIFI-password or kmail-password, or start kwalletmanager directly
3. Wait too long to enter the password (likely happens on older machines when lots of apps are popping up from session restore or the password-window is somewhere in the background)

OBSERVED RESULT
* A window from KDE Wallet Service pops up, wanting to create a new wallet named "Did not recieve a reply ...". I don't want to do this, so I cancel this.
* No WIFI, no mail-password. KDEWallet keeps closed 
* Trying to re-open kdewalletmanager via start-menu opens an empty, unresponsive window, waits for approx. 1 minute, then shows another almost empty window with content showing an error message (Did not receive a reply)

EXPECTED RESULT
KDEWallet asking for wallet password again, showing on-top of other windows

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.20.0
Qt Version: 6.9.3

ADDITIONAL INFORMATION
* This only happens when the user fails to enter the kwallet-password on time. If its entered within the timout period, everything works fine.
Comment 1 Alexander Puchmayr 2026-01-03 10:38:57 UTC
Seems identical to https://bugs.kde.org/show_bug.cgi?id=504678 
The fix should work since frameworks 6.15, but it is here again.
Comment 2 michaelk83 2026-01-08 18:00:03 UTC
(In reply to Alexander Puchmayr from comment #1)
> Seems identical to https://bugs.kde.org/show_bug.cgi?id=504678 
> The fix should work since frameworks 6.15, but it is here again.

The 2nd part where things become unresponsive after you cancel the New Wallet dialog, does indeed look like bug 504678. This has been recently reported again in bug 514189.

However, I don't think that you should be getting the New Wallet dialog just because you failed to enter the wallet password on time. So I'm marking that as the key bug here. What I think happens is KWallet sees that it can't open the existing wallet (since you didn't provide the password in time), and falls back to creating a new wallet instead. That's incorrect behavior IMO. It should just return an error to whichever client app requested access.
Comment 3 michaelk83 2026-01-10 11:40:12 UTC
(In reply to michaelk83 from comment #2)
> What I think happens is KWallet sees that it can't open the existing wallet 
> (since you didn't provide the password in time), and falls back to creating
> a new wallet instead.

Actually, it's a bit more complicated:
1. `listCollections()` tries to connect to the service to get the list of existing wallets.
2. This requires opening a session, which prompts the user for the wallet password.
3. If the user fails to provide the password, the connection fails, so `listCollections()` returns an empty list and an error.
4. `openInternal()` *should* see the error and quit, but looks like it falls back to create a new wallet anyway??

(1,3) https://invent.kde.org/frameworks/kwallet/-/blob/master/src/runtime/kwalletd/secretserviceclient.cpp?ref_type=heads#L485-490
(2,3) https://invent.kde.org/frameworks/kwallet/-/blob/master/src/runtime/kwalletd/secretserviceclient.cpp?ref_type=heads#L255-263
(4) https://invent.kde.org/frameworks/kwallet/-/blob/master/src/runtime/kwalletd/kwalletd.cpp?ref_type=heads#L342-347
Comment 4 michaelk83 2026-01-10 19:50:04 UTC
*** Bug 514413 has been marked as a duplicate of this bug. ***