Bug 1282642

Summary: kmail not saving/using passwords properly (kwallet?)
Product: [Fedora] Fedora Reporter: Tom Canavan <tmscanavan>
Component: kdepimAssignee: Than Ngo <than>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 23CC: jgrulich, jreznik, ltinkl, me, ovasik, rdieter, smparrish, than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 15:59:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Canavan 2015-11-16 23:57:06 UTC
Description of problem:
Using Fedora 23.
uname -a
Linux Midnight 4.2.5-300.fc23.x86_64 #1 SMP Tue Oct 27 04:29:56 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  Updates current as of 11-16-15 at 5:25 PM Chicago time.  

When I try to open kwalletmanager from the launcher, it opens a small blank window that I can do nothing with.  I have to just terminate it. If I go to system monitor and watch what is happening during this time, kwalletd is listed as a zombie all the time unless I click on Kwalletmanager from the launcher.  When I do that, I see that kwalletd keeps opening new processes of itself, with different process id's and closing them at a rather rapid pace. And I just have to terminate it.   If I open the kwallet configuration from system settings and click on "launch wallet manager", it opens kwalletmanager. Under "these applications are currently connected to this wallet", it lists kwalletmanager5.  When I click "change password, it opens a dialog that supposedly lets me change it.  Now I don't know if it is being saved or not, but Kmail refuses to even recognize Kwallet as being enabled, and it will not get my email unless I type in my email password every time.  This is very annoying.  


How reproducible:
Every time

Steps to Reproduce:
1.Click on Kwalletmanager from the launcher
2.Or click on "account details" from system settings
3.Try to save a password and then set kmail to save a password in kwallet

Actual results:
Launcher launches a blank window
Kwalletmanager launches from system settings, but only kwalletmanager5 is listed.  Whatever it saves in the save password dialog seems to be unavailable to kmail at least.  I have not tried other apps with it.

Expected results:
I expect kwalletmanager to save my password and that it will be available to kmail.  


Additional info:
Now, I notice that bugs have been filed on this issue on the kde bug tracker.  On bug 353622 at the kde site, the tech there says that this issue seems to be related to the distributions, so that why I am posting here.  Help getting this straightened out would be very much appreciated.  I don't like the kwallet system, but as long as we're forced to use it, I would like it to work.

Comment 1 Tom Canavan 2015-11-17 00:05:13 UTC
Here's something interesting from /var/log/mesages.  I don't know if it will help, but here it is:

Nov 11 13:40:22 Midnight sddm: kwalletd: Waiting for hash on 14-
Nov 11 13:40:22 Midnight sddm: kwalletd: waitingForEnvironment on: 20
Nov 11 13:40:22 Midnight sddm: kwalletd: client connected
Nov 11 13:40:22 Midnight sddm: kwalletd: client disconnected

Comment 2 Fedora Update System 2015-11-17 15:56:19 UTC
kwalletmanager5-15.08.3-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2a29c16098

Comment 3 Fedora Update System 2015-11-19 15:27:53 UTC
kwalletmanager5-15.08.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update kwalletmanager5'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2a29c16098

Comment 4 Fedora Update System 2015-11-19 16:56:22 UTC
kwalletmanager5-15.08.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update kwalletmanager5'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2a29c16098

Comment 5 Tom Canavan 2015-11-19 20:49:40 UTC
Thank you. I will also give this feedback at the bodhi site.   I did install that version from the testing repo and rebooted.  Kwalletmanager5 now opens normally with the info and options displayed. I make sure the kwallet system is enabled.   When I look at system monitor, kwalletd is no longer trying to start itself repeatedly, but is still listed as a zombie.  (not sure what that means.)

Relevant lines from /var/log/messages:
Nov 19 14:22:55 Midnight dbus[733]: [system] Activating service name='org.kde.kcontrol.kcmkwallet5' (using servicehelper)
Nov 19 14:22:55 Midnight dbus[733]: [system] Successfully activated service 'org.kde.kcontrol.kcmkwallet5'

However, when I go to kmail and try to reconfigure my account, the kmail settings dialog box *still* tells me that kwallet has been disabled in system settings.  I'm not sure if that is a bug in kmail or in the kwallet system.  Should I now file a new bug?  Which component should I file it against?  Please advise.

Comment 6 Rex Dieter 2015-11-19 20:52:05 UTC
fyi, 

kwalletmanager5 is for kf5-kwallet and other KDE Framework 5 applications.

kmail is (still) a kde4 application, so it uses kde4's kwallet (from kde-runtime), and configurable via kwalletmanager (no 5).

Comment 7 Rex Dieter 2015-11-19 20:53:02 UTC
So sorry, I think I contributed to the confusion mentioning kwalletmanager5 here previously

Comment 8 Tom Canavan 2015-11-19 21:25:17 UTC
Thank you Rex.  Yes, I am very confused during this transition.  I cannot figure a way to control kwalletmanager from kwalletmanager5.  There is no setting for that.  And when I try to start kwalletmanager(the old one), the terminal tells me it has been disabled.  All I want to do is get my email without having to punching a password every time.  Thanks again.

Comment 9 Rex Dieter 2015-11-19 22:31:20 UTC
Let me re-iterate: there are 2 Kwallet managers

1.  kwalletmanager (for kde4 apps)

2.  kwalletmanager5 (for kf5 apps)

You want to use 1.  

kwalletmanager5 cannot be used to control the wallet used by kmail (a kde4 application), and kwalletmanger cannot be used to control the wallet used by kf5 applications.

yes, it's confusing that you have 2 separate applications, and that you have to know which one to use (sorry, that's kde upstream's problem)

Comment 10 Tom Canavan 2015-11-19 23:26:57 UTC
Thank you again Rex.  Yes, that's the way I thought it was supposed to work.  That's why in my original report I specified kwalletmanager and not kwalletmanager5.  It threw me of when you said "so it uses kde4's kwallet (from kde-runtime), and *configurable via kwalletmanager (no 5)*."

So the problem is still what I reported.  I didn't mention kwalletmanager5 in my report. Someone else mentioned that. I couldn't understand why he invited me to install that kwallet5 version from testing, but I did it anyway. I say again kwalletmanager (for kde4 apps) will not start and when I try to start it manually from a terminal I get the message that it has been disabled. And the last time I tried that, it locked up my whole desktop. So the problem remains what I originally reported.  

As for whether it is a fedora problem or it is upstream, I do not know. It is almost impossible for a normal user to know such things.   As I said I reported here because a tech on the kde bug tracker said it seemed to be related to the distributions. Here is the gentleman's name and what he said:

 "Valentin Rusu 2015-11-15 20:16:12 UTC
Seems to that the problems are related to your distributions. Please file a bug with them."

I did not file the bug at the kde site, just commented on it because it was happening with my system also.
Here is a link to the bug at the kde site:
https://bugs.kde.org/show_bug.cgi?id=353622

Thank you again

Comment 11 Rex Dieter 2015-11-20 01:00:34 UTC
Ah ok, so at some point you disabled kwallet, and indeed kwalletmanager does not work when kwallet is disabled.

Arguably, that's a bug, because running kwalletmanager is the generally the only easy way to enable it again.

Good news, there's an alternative command-line approach:

kwriteconfig --file kwalletrc --group Wallet --key Enabled true

Now, kwalletmanager should work again.

Comment 12 Rex Dieter 2015-11-20 01:10:54 UTC
I think this upstream bug matches the symptoms here,
https://bugs.kde.org/show_bug.cgi?id=327086

Comment 13 Tom Canavan 2015-11-20 02:00:46 UTC
Yes i just checked that bug and it does sound similar.  OK thanks again Rex. 
Yes I did disable kwallet at one point, because I naturally assumed that I could go into system settings and enable it again if I wanted to.  But obviously that wasn't the case.
The command you gave me seemed to work partially.  Now when I go to kmail and try to modify my pop3 account, instead of it saying that the kwallet system has been disabled, it pops up a dialog and asks for the kwallet password.  So far, so good.  But when I type in the password, it won't recognize it.  I've tried several different passwords, (including a blank one, which the kde people have told me should work).  So apparently the kwallet in system settings (which is for kwallet5) is not storing my password for kmail (a kde4 app.)  True?  I don't know.  anyway I seem to have two kwalletrc's on my system if that's any help.  The one in $HOME/.kde/share config says this:

[$Version]
update_info=kded.upd:kde3.0

While the one in $HOME/.config says this:

[Migration]
alreadyMigrated=true

[Wallet]
Close When Idle=false
Close on Screensaver=false
Default Wallet=kdewallet
Enabled=true
First Use=false
Idle Timeout=10
Launch Manager=false
Leave Manager Open=false
Leave Open=true
Prompt on Open=false
Use One Wallet=true

At any rate, I'm still stuck having to punch my password in to get my email no matter what kwallet password I use, which shouldn't be necessary.
I will follow that upstream bug you mentioned and see what comes of it.
Thanks again.

Comment 14 Rex Dieter 2015-11-20 16:33:09 UTC
Apparently you don't remember your old kde4 kwallet password

I think you can still use kwalletmanager to close/delete your old one, and create a new one (with a password you *do* know, ideally either matching your login password or leave it blank)

Comment 15 Tom Canavan 2015-11-20 19:48:06 UTC
Yes I do. I remember all passwords because I write them down.  This password just doesn't work.  None of the ones I have set in the original wallet (kdewallet) work and I have tried resetting it several times with different ones.

So I did  as you suggested and added another wallet.  There is no option to delete the original.  What there is, is a window inside the wallet manager that lists folders which can be deleted.  So if I click on my new wallet, it will list my folders, which I could delete if I wanted to.  However when I click on the original wallet (called kdewallet) no folders show up in that window.  I'm guessing that is because it is the default and there needs to always be a wallet, so it won't let you delete its folders.
So I go to kmail -->settings  --> (my pop3 account)  -->  modify and it pops up a dialog box which says that my pop3 account has requested to open the wallet "kdewallet".  It does not give me the option to use the other wallet that I had added anywhere within the kmail settings that I can find. The same thing happens when I go through the "account wizard" in case you were wondering that. Perhaps that is an upstream problem in kmail. Maybe they should incorporate that choice into the UI somehow.  I don't know.  All I can do is report symptoms.
But thanks again for your help.

Comment 16 Rex Dieter 2015-11-20 19:53:57 UTC
This works for me:

1.  run kwalletmanager

2.  file->close all wallets

3.  file->delete wallet

4.  file->new wallet, named 'kdewallet'  (I'd recommend using classic encryption, not gpg)

Comment 17 Tom Canavan 2015-11-20 21:54:04 UTC
OK thanks.  Did that and it succeeded in deleting the default wallet named kdewallet. Added a new wallet named kdewallet and gave it a password.  The only option about encryption I saw was one to import an encrypted one and I have nothing to import. Logged out and in again.  


But then when I go to kmail and that dialog tells me that kmail is requesting to open kdewallet,  I type in that new password, and it tells me it is the wrong password.  (Error -9  Possibly wrong password.)

Then I tried something else.  I deleted kdewallet and made a new wallet named "mywallet" thinking kmail would ask for it if it was the default, which it now was as per ~/.config/kwalletrc:

[Migration]
alreadyMigrated=true

[Wallet]
Close When Idle=false
Close on Screensaver=false
Default Wallet=mywallet
Enabled=true
First Use=false
Idle Timeout=10
Launch Manager=false
Leave Manager Open=false
Leave Open=true
Local Wallet=kdewallet
Prompt on Open=false
Use One Wallet=false

That didn't work either.  Kmail still asked for the kdewallet even though it no longer existed and my new one was the default.

Then I used kfind to search my home directory for any hidden files having to do with kmail.  Found a bunch, but nothing configurable that would let me change the wallet that kmail asks to open.  Maybe there's another way to configure that, I don't know about.

Thanks again.

Comment 18 Tom Canavan 2015-11-22 04:05:51 UTC
Here's something strange.  I just checked my email.  Not a peep from Kwallet.  It didn't ask for the wallet to be opened.  And kmail didn't ask for a password.  It just got my mail.  I thought that was strange, so I opened kwallet manager to see what was going on.  kdewallet was closed.  So I logged out and in again.  Went to check my email and up popped kwallet asking to be opened.  Put in the password.  That didn't work.  Clicked cancel.  Up popped the kmail dialog wanting my pop password because it couldn't get it from kwallet. I didn't give it a password, I just clicked cancel on it.  And guess what.  It went ahead and checked my email anyway. So the system is storing my pop password someplace.  If I open kwalletmanager I can open the wallet with my password in the manager's dialog.  I know this all sounds strange, and you might even think I'm pulling your leg, but that what happened. This is really flaky.  I have no idea what's going on any more.  Good luck with it.  Frankly I hope they just get rid of kwallet.  It had been nothing but a headache since its inception.

Comment 19 Rex Dieter 2015-11-22 15:51:46 UTC
kwallet is indeed a headache for anyone that tries to fight it :-/


As far as I'm concerned, this is definitely more a support issue and no longer a bug.  I'd encourage you to contact kdepim upstream mailing list or bugzilla for further support to diagnose what's going wrong in your case.

Comment 20 Tom Canavan 2015-11-22 19:52:15 UTC
No, I'm not fighting it any more.  I gave up on that a long time ago.  Just trying to live with it now.  Let's backtrack a bit.  A few posts ago you told me to got to file-->delete wallet.  Then to start a new one and choose the encryption.  I didn't understand because I didn't get that dialog box.  The reason I didn't is because there are two wallets, even though only one is listed.  One is in ~/.local/share/kwalletd and the other one is in ~/.kde/share/apps/kwallet.  When I deleted it, it deleted the one in ~/.local/share/kwalletd, but not the one in ~/.kde/share/apps/kwallet.  And that Is why I didn't get that dialog box to choose encryption.  I didn't get that until I manually deleted both those wallets.  That evidently is a bug, because it didn't work the way you thought it would.  When I store mail from kmail, it gets stored in the wallet in ~/.kde/share/apps/kwallet, not the one in ~/.local/share/kwalletd.  When I enter passwords into the wallet manager manually, they get shared in the wallet in ~/.local/share/kwalletd and I can't get mail with when its password is stored there. That makes no sense. That's a bug.  When I go to export an .xml file the one exported is the one in ~/.local/share/kwalletd.  So evidently I can't even export the other one.  That's a bug.  When something doesn't work the way the flowchart says it's supposed to work, that's a bug, by my definition.  The bug may be in the code, or in the flowchart, but it's a bug.  I'm not a C programmer, but I'm in my sixties and I've been working with computers since the days of Fortran and Cobol in the seventies.  And with Linux for the last 12 years.  So don't tell me these aren't bugs, because that insults my intelligence.  You're right though.  It's not *a* bug.  It's probably several, both upstream and downstream.  If you want me to take it over there, that's fine, I can do that.  But you know what, we users feel like tennis balls getting bounced back and forth. They blame you, you blame them. This thing with kwallet has been going on for years.  
Secondly, as for it being a support issue, if there was documentation shipped with the distro, People might not need as much support. When I click on "Help", I get nothing.  And documentation is out there, but people shouldn't have to go searching for it. I like Fedora because it has much more software available than the others, and that's why I use it. But Fedora is a distro that puts out bleeding edge softeware and wants people to help find and report bugs so Red Hat can package it and sell it.  I'm fine with that.   But you need to help us help you.  I know there are support forums.  They're the full of the same kind of stuff I'm telling you about.  You think I'm the only one unhappy?  Google it.  Problems all over.  and until you and upstream get together and work these things out instead of passing the buck, nothing will be fixed.  I've only spent so much time with you because it seemed like you were honestly trying to record symptoms to get hints on what might be wrong.  I know you have a lot of knowledge, because I've seen you on other forums.  It can be done, but it takes the will.  Nuff said.

Comment 21 Rex Dieter 2015-11-22 23:19:12 UTC
Sounds like you used the wrong kwalletmanager, to re-iterate:

kwalletmanager5 is for kf5 apps (this one stores wallets under ~/.local)

kwalletmanager is for kde4 apps (like kmail, wallets are under ~/.kde)

Let's try to stick with technical details here (anything else is offtopic)

Comment 22 Tom Canavan 2015-11-23 00:16:31 UTC
Ahh, Thank you.  Now we're getting somewhere. You must have thought I was using kwalletmanager when kwalletmanager5 is the only one in the launcher and in system settings. I had no idea kwalletmanager could be launched separately. You could think about putting them both in there in both places and *documenting* that in the release notes so people know what's going on.  I thought with the migration kwalletmanager5 handled both of them. People can't know these things automatically.  That's why these bug reports devolve into support issues. OK they work and kwalletmanager doesn't bother me any more.  Thank you.

Comment 23 Rex Dieter 2015-11-23 03:14:54 UTC
Good question, the .desktop files are there,

$ kbuildsycoca5 --menutest | grep kwallet
...
System/ org.kde.kwalletmanager5.desktop
System/ kde4-kwalletmanager.desktop


but indeed only one actually gets displayed.  I think that could be argued as a bug, I'll look into that.

Comment 24 Fedora End Of Life 2016-11-24 13:30:13 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 25 Fedora End Of Life 2016-12-20 15:59:46 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.