Bug 345382

Summary: KTP asks for password while it's saved in kwallet and the wallet is open
Product: [Unmaintained] telepathy Reporter: Alexander Potashev <aspotashev>
Component: auth-handlerAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: diane, gajdos.mirek, loic.yhuel, mklapetek
Priority: NOR    
Version: git-latest   
Target Milestone: Future   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alexander Potashev 2015-03-21 05:20:11 UTC
When KTP tried to reconnect to my Google or ICQ account, ktp-auth-handler password dialogs pop up asking for password for those accounts. My passwords are saved in KWallet5 and I can see the wallet is open in kwalletmanager5. Kwalletmanager5 shows me the passwords under section "telepathy-kde":
 * At "gabble/jabber/aspotashev_40gmail_2ecom0" for Google,
 * At "haze/icq/_3xxxxxxxxx0" for ICQ, where "xxxxxxxxx" is my ICQ id.

I think KTP should not be asking for password if it already has a password saved in KWallet.

Reproducible: Always




Version as reported in the About dialog of ktp-contactlist: 15.03.95
Comment 1 Martin Klapetek 2015-03-21 09:54:38 UTC
KTp in 15.04 has moved to Accounts SSO infrastructure which works differently and the passwords are stored with it. The password dialog is a result of migration, you just need to enter it, check Save Password and it will get saved in Accounts SSO.
Comment 2 Alexander Potashev 2015-03-21 13:36:09 UTC
If I check Save Password, the account does not connect (!) and the password dialog is open again on the next try. Is there a way to see the saved passwords like I could do that with KWalletManager?
Comment 3 Martin Klapetek 2015-03-21 17:21:38 UTC
Ah interesting. If you have the signon-kwallet-extension (which you totally should have), then you should have the passwords in KWallet under accounts/.

Could you perhaps run "ktp-auth-handler --persist" from konsole (it's in libexec somewhere) and try to connect and post the output?
Comment 4 Alexander Potashev 2015-03-21 20:37:54 UTC
It segfaults. GDB output:

(gdb) run --persist
Starting program: /usr/lib64/libexec/ktp-auth-handler --persist
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe4c71700 (LWP 27115)]
New job started. 1 jobs currently running
New job started. 2 jobs currently running
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Job finished. 1 jobs currently running
("X-TELEPATHY-PASSWORD")
Starting Password auth
Requesting password
New job started. 2 jobs currently running
("X-OAUTH2", "X-GOOGLE-TOKEN", "PLAIN", "X-TELEPATHY-PASSWORD")
Starting Password auth
Requesting password
Saving password in SSO
[New Thread 0x7fffdc0ba700 (LWP 27126)]

(process:27114): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed

(process:27114): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
Creating account with providerName "ktp-haze-icq"
identityimpl.cpp 172 storeCredentials Storing credentials

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74174e4 in SignOn::IdentityImpl::storeCredentials(SignOn::IdentityInfo const&) () from /usr/lib64/libsignon-qt5.so.1
(gdb) bt
#0  0x00007ffff74174e4 in SignOn::IdentityImpl::storeCredentials(SignOn::IdentityInfo const&) () from /usr/lib64/libsignon-qt5.so.1
#1  0x000000000042889c in XTelepathyPasswordAuthOperation::storeCredentials(QString const&) ()
#2  0x0000000000429c64 in XTelepathyPasswordAuthOperation::onDialogFinished(int) ()
#3  0x00007ffff6411c81 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#4  0x00007ffff54155ce in QDialog::finished(int) () from /usr/lib64/libQt5Widgets.so.5
#5  0x00007ffff5415ce8 in QDialog::done(int) () from /usr/lib64/libQt5Widgets.so.5
#6  0x00007ffff6411c81 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#7  0x00007ffff6411c81 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#8  0x00007ffff55a98d2 in QAbstractButton::clicked(bool) () from /usr/lib64/libQt5Widgets.so.5
#9  0x00007ffff5322fc6 in QAbstractButtonPrivate::emitClicked() () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007ffff5323ade in QAbstractButtonPrivate::click() () from /usr/lib64/libQt5Widgets.so.5
#11 0x00007ffff5323c54 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007ffff528b251 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007ffff524b9cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007ffff5251287 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007ffff63e2435 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#16 0x00007ffff524fd11 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQt5Widgets.so.5
#17 0x00007ffff52a2816 in QWidgetWindow::handleMouseEvent(QMouseEvent*) () from /usr/lib64/libQt5Widgets.so.5
#18 0x00007ffff52a472b in QWidgetWindow::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5                                        
#19 0x00007ffff524b9cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5                
#20 0x00007ffff5250896 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5                              
#21 0x00007ffff63e2435 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5                     
#22 0x00007ffff4d02eee in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()                   
   from /usr/lib64/libQt5Gui.so.5                                                                                                    
#23 0x00007ffff4d046f5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()     
   from /usr/lib64/libQt5Gui.so.5                                                                                                    
#24 0x00007ffff4ceb0a8 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()                   
   from /usr/lib64/libQt5Gui.so.5                                                                                                    
#25 0x00007fffe7edd9b0 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) ()                                               
   from /usr/lib64/qt5/plugins/platforms/libqxcb.so                                                                                  
#26 0x00007ffff2cfa704 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0                                                
#27 0x00007ffff2cfa948 in g_main_context_iterate.isra () from /usr/lib64/libglib-2.0.so.0                                            
#28 0x00007ffff2cfa9ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0                                               
#29 0x00007ffff64396ec in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()                              
   from /usr/lib64/libQt5Core.so.5                                                                                                   
#30 0x00007ffff63e039b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5                 
#31 0x00007ffff63e7a06 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#32 0x00000000004163e7 in main ()
(gdb)
Comment 5 Diane Trout 2015-07-29 06:06:36 UTC
I'm having what appears to be the same problem. My backtrace looks like the following:

This is with the 15.04.3 releases of ktp and libaccounts-glib0_1.18+20150112 libaccounts-qt_1.13+20140905-1 libsignon-qt5-1_8.57+20150423-1~ (All unreleased debian packages)

Unknown signature value:  794
Unknown signature value:  795
Unknown signature value:  7
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Unknown signature value:  795
Job finished. 1 jobs currently running
New job started. 2 jobs currently running
("X-OAUTH2", "X-GOOGLE-TOKEN", "PLAIN", "X-TELEPATHY-PASSWORD")
Starting Password auth
Requesting password
New job started. 3 jobs currently running
New job started. 4 jobs currently running
("PLAIN", "SCRAM-SHA-1", "DIGEST-MD5", "X-TELEPATHY-PASSWORD")
Starting Password auth
Requesting password
("PLAIN", "SCRAM-SHA-1", "DIGEST-MD5", "X-TELEPATHY-PASSWORD")
Starting Password auth
Requesting password
Saving password in SSO
[New Thread 0x7fffdb9cb700 (LWP 12213)]

(process:12160): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed

(process:12160): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
Creating account with providerName "ktp-jabber"
../../../../lib/SignOn/identityimpl.cpp 172 storeCredentials Storing credentials

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff741ffb1 in SignOn::IdentityInfo::id() const () from /usr/lib/x86_64-linux-gnu/libsignon-qt5.so.1
(gdb) bt
#0  0x00007ffff741ffb1 in SignOn::IdentityInfo::id() const () from /usr/lib/x86_64-linux-gnu/libsignon-qt5.so.1
#1  0x00007ffff7429ca3 in ?? () from /usr/lib/x86_64-linux-gnu/libsignon-qt5.so.1
#2  0x0000000000429bba in XTelepathyPasswordAuthOperation::storeCredentials (this=this@entry=0xde2750, secret=...)
    at ../x-telepathy-password-auth-operation.cpp:216
#3  0x000000000042b01a in XTelepathyPasswordAuthOperation::onDialogFinished (this=0xde2750, result=<optimized out>)
    at ../x-telepathy-password-auth-operation.cpp:157
#4  0x00007ffff41d012e in QMetaObject::activate (sender=sender@entry=0xe4feb0, signalOffset=<optimized out>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffcd20) at kernel/qobject.cpp:3717
#5  0x00007ffff41d07a7 in QMetaObject::activate (sender=sender@entry=0xe4feb0, 
    m=m@entry=0x7ffff5aa3280 <QDialog::staticMetaObject>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x7fffffffcd20) at kernel/qobject.cpp:3582
#6  0x00007ffff577d88e in QDialog::finished (this=this@entry=0xe4feb0, _t1=_t1@entry=1) at .moc/moc_qdialog.cpp:216
#7  0x00007ffff577dfe8 in QDialog::done (this=0xe4feb0, r=1) at dialogs/qdialog.cpp:580
#8  0x00007ffff41d012e in QMetaObject::activate (sender=0xde6c20, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3717
#9  0x00007ffff41d012e in QMetaObject::activate (sender=sender@entry=0xe30850, signalOffset=<optimized out>, 
    local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fffffffcf80) at kernel/qobject.cpp:3717
#10 0x00007ffff41d07a7 in QMetaObject::activate (sender=sender@entry=0xe30850, 
    m=m@entry=0x7ffff5ab7a60 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=2, 
    argv=argv@entry=0x7fffffffcf80) at kernel/qobject.cpp:3582
#11 0x00007ffff592c452 in QAbstractButton::clicked (this=this@entry=0xe30850, _t1=false)
    at .moc/moc_qabstractbutton.cpp:298
Comment 6 gajdos.mirek 2015-09-29 11:12:35 UTC
same problem here, why is it resolved invalid?
Comment 7 gajdos.mirek 2015-09-29 14:28:30 UTC
(In reply to gajdos.mirek from comment #6)
> same problem here, why is it resolved invalid?

looks like some misconfiguration in telepathy, this helped:
mv .local/share/telepathy{,~}
(you have to create account settings after that)
Comment 8 Loïc Yhuel 2015-10-11 22:44:16 UTC
Everything was working properly on Fedora 22, and now on Fedora 23 I have this issue (perhaps due to ktp 15.08). It asks for the password after a few seconds, if I don't check the "save password" checkbox it works, else ktp-auth-handler crashes.
Deleting then creating the account again didn't help.

org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: Unable to find account for id 0
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: Unable to find account for id 0
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: Unable to find account for id 0
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: Unable to find account for id 0
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: Credentials job error: "Could not find account"
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): accounts-glib-CRITICAL **: ag_manager_load_account: assertion 'account_id != 0' failed
org.freedesktop.Telepathy.Client.KTp.SASLHandler[1116]: (process:10040): GLib-CRITICAL **: g_error_free: assertion 'error != NULL' failed
kernel: traps: ktp-auth-handle[10040] general protection ip:7fc277a7a51c sp:7fff01b4c990 error:0 in libsignon-qt5.so.1.0.0[7fc277a71000+3a000]
Comment 9 Loïc Yhuel 2015-10-11 23:56:09 UTC
(In reply to gajdos.mirek from comment #7)
> (In reply to gajdos.mirek from comment #6)
> > same problem here, why is it resolved invalid?
> 
> looks like some misconfiguration in telepathy, this helped:
> mv .local/share/telepathy{,~}
> (you have to create account settings after that)

I did that, now creating the account doesnt work :
 - I see it in systemsettings5, but the configure button doesn't work
 - it isn't in .local/share/telepathy/mission-control/accounts.cfg
 - ktp-contact-list doesn't see it : "You have no IM accounts configured, would you like to do that now ?"
Comment 10 Martin Klapetek 2015-10-12 02:32:28 UTC
>  - I see it in systemsettings5, but the configure button doesn't work

Fixed in 15.08.2.

>  - it isn't in .local/share/telepathy/mission-control/accounts.cfg

It's not supposed to be because...

>  - ktp-contact-list doesn't see it : "You have no IM accounts configured, would you like to do that now ?"

...you are missing telepathy-accounts-signon package, please install that and notify your distro packagers of a missing dependency.
Comment 11 Loïc Yhuel 2015-10-12 03:09:15 UTC
(In reply to Martin Klapetek from comment #10)
> ...you are missing telepathy-accounts-signon package, please install that
> and notify your distro packagers of a missing dependency.
Thank you, it fixed my issues.
Fedora only has a package under review (since end of August...), so I had to build it myself.