SUMMARY Using kwallet with (default) GPG backend results in various issues. Eventually even kwallet gets angry throwing misc errors (ioctl). Fixed on installation of (missing?) pinentry-qt STEPS TO REPRODUCE 1. Install fresh KDE neon 2. Setup kwallet w/ GPG wallet 3. (maybe required?) install Chromium (or adjacent app that uses wallet?) a. note -- in user's experience adjacent app was installed _first_ before initializing wallet, but not convinced that's needed to repro. worth noting. 4. wait; reboot; suspend (?) 5. both kwallet and adjacent app get angry on next-ish fresh open OBSERVED RESULT See attachment GPG Error / Inappropriate ioctl for device EXPECTED RESULT Wallet works fine independently or with other GUI applications SOFTWARE/OS VERSIONS Operating System: KDE neon User Edition KDE Plasma Version: 6.5.4 KDE Frameworks Version: 6.21.0 Qt Version: 6.10.1 Kernel Version: 6.14.0-37-generic (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ Ultra 7 258V Memory: 32 GiB of RAM (30.9 GiB usable) Graphics Processor: Intel® Graphics Manufacturer: LENOVO Product Name: 83LC System Version: Yoga 9 2-in-1 14ILL10
Crash may be overkill here -- maybe normal priority is more appropriate (wasn't sure as this is a GUI bug/crash to some degree but not a system crash)
small correction to report > note -- in user's experience adjacent app was installed _first_ before initializing wallet, but not convinced that's needed to repro. worth noting. was installed and _loaded_ first (triggering initial ioctl error that was resolved on wallet creation) i'm not sure if this could be important to repro; i doubt it; but worth worth mentioning.
As I recall, GPG relies on pinentry to get the GPG key passphrase. There are more than one variant of pinentry, though I think pinentry-qt should be default on KDE. Since you're using a GPG wallet, and reporting "various issues" - if those "various issues" include ~1 minute delays, check if you may be running into bug 458085 comment 85. In particular, if you have Secret Service enabled in KWallet, you may need to set the `no-allow-external-cache` option in gpg-agent. > See attachment You forgot to attach the attachment.
Short description of what happened for me on NixOS Working: nixos-26.05pre916364.3e2499d5539c Booting the previous generation. Broken: nixos-26.05pre923638.5912c1772a44 kwallet fails to unlock wallet: "Error code -41: Unknown cipher or hash" KMail becomes unusable (repeated auth prompts / cannot access secrets). When it works, the unlock prompt asks for my OpenPGP secret key passphrase, so kwallet is using the GPG/OpenPGP backend. Bug notes mention: "Fixed on installation of (missing?) pinentry-qt." I haven't yet tested adding pinentry-qt to the broken generation (configuration.nix). Note on unlocking: I start my session with startplasma-wayland (no display manager / no PAM login), so kwallet is not automatically unlocked at login via PAM. I unlock the wallet manually when KMail triggers the unlock popup. I don't know whether PAM-based automatic unlock supports GPG/OpenPGP in this setup.
(In reply to Chris from comment #4) > Broken: nixos-26.05pre923638.5912c1772a44 > kwallet fails to unlock wallet: "Error code -41: Unknown cipher or hash" Based on the source code, this indicates that the cipher type couldn't be determined from the wallet file header. Meaning either the wallet file hasn't been fully set up, or the file is corrupt. Possibly your system is trying to read the wrong file. I don't think that this is related to the OP.
(In reply to michaelk83 from comment #5) > (In reply to Chris from comment #4) > > Broken: nixos-26.05pre923638.5912c1772a44 > > kwallet fails to unlock wallet: "Error code -41: Unknown cipher or hash" > > Based on the source code, this indicates that the cipher type couldn't be > determined from the wallet file header. Meaning either the wallet file > hasn't been fully set up, or the file is corrupt. Possibly your system is > trying to read the wrong file. > > I don't think that this is related to the OP. Considering this appeared suddenly with the latest NixOS upgrade (nixpkgs/unstable), and I haven't changed anything related to kwallet/KMail since 2023, and the wallet/KMail works fine when I boot the previous NixOS generation, should I open a new bug for my specific case? Any suggestions for debugging steps I should try? (I've spent hours trying to debug it with no results.)
(In reply to Chris from comment #6) > Considering this appeared suddenly with the latest NixOS upgrade > (nixpkgs/unstable), and I haven't changed anything related to kwallet/KMail > since 2023, and the wallet/KMail works fine when I boot the previous NixOS > generation, should I open a new bug for my specific case? Since you're on nixpkgs/unstable, and the problem seems to be related to their latest upgrade, I would suggest filing a bug with NixOS.
Created attachment 188424 [details] screenshot of GUI / kwallet error Ah good catch on the missing attachment. I had to rewrite the report and missed it on the second go. The attachment wasn't terribly interesting, but the GUI error I see (vague ioctl)
NIX ASIDE -- > Considering this appeared suddenly with the latest NixOS upgrade (nixpkgs/unstable), and I haven't changed anything related to kwallet/KMail since 2023, and the wallet/KMail works fine when I boot the previous NixOS generation, should I open a new bug for my specific case? Any suggestions for debugging steps I should try? (I've spent hours trying to debug it with no results.) +1 with filing against nix. in the spirit of helping - if I were you I would try to track down the dependency shift around GPG (or your algo), kwallet, what dependencies they use in general there & how the new nix install changed those. maybe your old encryption algo is no longer default or supported etc? Otherwise you might just try exporting your wallet temporarily and creating a new one / importing in your new distro. Anywho - back to the main show .. RE DELAY -- > if those "various issues" include ~1 minute delays No no 1 minute delays. Behavior was always instant .. I would just generally have issues connecting with the wallet. The "various issues" was a short way of saying that this issue surfaced in a couple unpredictable ways -- all of which have gone away with addition of pinentry-qt. Initially I would get an error (attachment in above comment) opening chromium. It would keep popping up rendering chromium unusable (chromium doesn't seem to initialize it's network stack until the wallet is clarified :/) The other weird issue I ran into was kwallet (& manager?) itself. I *think* I remember it being a little grumpy when I set the wallet up (read: potentially warnings? don't remember for sure but it didn't block wallet creation -- may be conflating with original chromium issue .. i was generally confused at that stage) But the _main issue_ I had with kwallet. It actually had a very similar error as chromium _after full reboot_. It was also having issues opening it's own wallet. Instead of getting a password dialogue (to generally unlock the wallet to the system) on login, I was getting some similar are same error as chromium. This is what sent me on my last debugging spree, getting pinentry-qt installed etc. I didn't really know what normal behavior was at the time, so apologies for the slighty fuzzy, verbose report. I wasn't a perfect observer. My main takeaway though is that after installing pinentry-qt _both_ of these issue have disappeared. I am greeted with a wallet unlock request from kwallet/manager on boot, and no applications have any issue using the wallet.
(In reply to Nik from comment #8) > Created attachment 188424 [details] > screenshot of GUI / kwallet error Oh, this is an old one. Previously reported in bug 475389 back on KDE 5. I'll leave this issue open since it's addressing the KDE Neon packaging, rather than the underlying kwallet or GPG error. I'm guessing that cryptic error just meant GPG couldn't find how to get its passphrase.
> keep popping up [in chromium] I mean to say -- regardless of how I navigated the error (retry, cancel see screenshot) it would come right back ad infinitum (ad nauseum ..) *Probably useful context* -- I should have maybe mentioned .. I don't daily drive linux (gui .. gnome, kde et al) but am trying to at the moment. So I'm am .. - vested in helping how I can to (potentially longer term .. there are a lot of issues I'm running into with the general user exp [not necessarily kde]) - little frazzled, confused and trying to do this all on this laptop so bear with me If I have other issues I'm unsure of how to report, would the discuss (forum?) be a good place to do it? I suspect many of the other issues are not KDE related, but may be helpful to surface etc. Mostly sleep / wake hardware but could potentially be a bit of both.
> I'm guessing that cryptic error just meant GPG couldn't find how to get its passphrase. yes that matches my experience. I think I got it (same or very similar) at first because there was no wallet. Then on reboot the wallet had similar issues (and did not get password prompt -- error instead) independent of chromium, which then also probably caused chromium to choke as it was never unlocked etc.
(In reply to Nik from comment #11) > If I have other issues I'm unsure of how to report, would the discuss > (forum?) be a good place to do it? Generally speaking, search first, since something similar may have been reported. Then, if you're not sure if it's a bug, a discussion forum is a good place to start. Once you're reasonably sure it's a bug, and it hasn't been reported yet, and ideally you know how to reproduce it (otherwise the devs can't do much about it), then go ahead and submit a bug. If you find an existing bug report that matches your case, feel free to add any _new_ info to the existing report.
(In reply to michaelk83 from comment #13) > (In reply to Nik from comment #11) > > If I have other issues I'm unsure of how to report, would the discuss > > (forum?) be a good place to do it? > > Generally speaking, search first, since something similar may have been > reported. Then, if you're not sure if it's a bug, a discussion forum is a > good place to start. Once you're reasonably sure it's a bug, and it hasn't > been reported yet, and ideally you know how to reproduce it (otherwise the > devs can't do much about it), then go ahead and submit a bug. > > If you find an existing bug report that matches your case, feel free to add > any _new_ info to the existing report. ofc. generally solid public bug tracker advice. i think i am looking to contribute more than reporting bugs (potentially fixing them) and in the process need some support triaging, learning the stack etc. generally was wondering if there's a good (social) place to do that or how one might start getting more involved. if you have any addt'l advice (outside of this tracker/thread) feel free to reach me via email. otherwise i will try to stay on topic from here.
(In reply to Nik from comment #14) > i think i am looking to contribute more than reporting bugs I'll just leave this here, since others may find it helpful too, and more contributors are always welcome: https://community.kde.org/Get_Involved (let this be the last off-topic comment) And to bring this back to topic, the bottom line for this issue is: Is looks like KDE Neon is missing pinentry-qt. It should be installed by default if kwallet is installed (maybe only as recommended default).