Bug 378436

Summary: Instance create job emits result too early
Product: [Frameworks and Libraries] Akonadi Reporter: Andre Heinecke <aheinecke>
Component: Account WizardAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: a.key, a.samirh78, account, dvratil, hiwatari.seiji
Priority: NOR    
Version: GIT (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Hack to fix racyness

Description Andre Heinecke 2017-04-04 14:41:44 UTC
Created attachment 104869 [details]
Hack to fix racyness

The KMail AccountWizard can fail with: "Could not convert value of setting 'AccountIdentity' to required type."

This happens for me in a fairly slow VM (one core, slow disk). But there happened very reliably.

The reason appears to be that Accountwizard's Resource::instanceCreateResult is called too early before the resource is fully created. 

Where:
   QDBusInterface iface(QStringLiteral("org.freedesktop.Akonadi.Resource.") + m_instance.identifier(), QStringLiteral("/Settings"));

isValid but the interface does not provide all Methods. The debug output surrounding this is:

    org.kde.pim.accountwizard: Setting up  "AccountIdentity"  for agent  "akonadi_imap_resource_12"
    org.kde.pim.accountwizard: Did not find D-Bus method:  "setAccountIdentity"  available methods are:
    org.kde.pim.accountwizard: "destroyed(QObject*)"
    org.kde.pim.accountwizard: "destroyed()"
    org.kde.pim.accountwizard: "objectNameChanged(QString)"
    org.kde.pim.accountwizard: "deleteLater()"
    org.kde.pim.accountwizard: "_q_reregisterTimers(void*)"
    org.kde.pim.accountwizard: "_q_serviceOwnerChanged(QString,QString,QString)"

Version does not really match. It was with accountwizard 0.2 from the current KDE Neon devedition gitstable ( 4:16.12.3+p16.04+git20170310.0110-0 ).

Attached Hack fixes the Problem for me but is of course not a real fix as it just adds a sleep before accessing the resource interface.
Comment 1 Jochen 2017-10-16 10:31:33 UTC
The problem still persists in accountwizard 4:17.08.2+p16.04+git20171013.0400-0 from the current KDE Neon devedition gitstable. I haven't tested if the patch still fixes the issue.
Comment 2 Ahmad Samir 2020-08-23 10:18:58 UTC
Is this still an issue?
Comment 3 a.key 2020-09-05 16:17:48 UTC
Yes,
Just happened to me when I attempted to add another account from g-suite (custom domain).

plasma version: 5.19.5
framework version: 5.70.0
qt version: 5.14.2