Bug 306218

Summary: akonadi crashes due to old resource
Product: [Frameworks and Libraries] Akonadi Reporter: kdebug
Component: Google ResourceAssignee: Daniel Vrátil <dvratil>
Status: RESOLVED DUPLICATE    
Severity: crash CC: kdepim-bugs
Priority: NOR    
Version: 4.8   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description kdebug 2012-09-03 22:50:53 UTC
Application: akonadi_googlecalendar_resource (4.8)
KDE Platform Version: 4.8.5 (4.8.5)
Qt Version: 4.8.2
Operating System: Linux 3.4.7-1.fc16.x86_64 x86_64
Distribution: "Fedora release 16 (Verne)"

-- Information about the crash:
Ran:
    akonadictl start

As far as I know, the "akonadi_googlecalendar_resource_6" reference is to an old resource (an old instance of the google calendar). This resource is in the MySQL "resource" and "collection" tables, but is not configured with applications (ie., Kontact).

I'm guessing that the issue is with akonadi not correctly pruning resources that should have been removed from the database, or with it not correctly handling resources that exist in the DB but are not in use (perhaps partially removed and therefore inconsistent?).

Running:
   akonadictl fsck
does not show (or resolve) any db inconsistencies.

The crash can be reproduced every time.

-- Backtrace:
Application: Google Calendars and Tasks (akonadi_googlecalendar_resource), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  0x00007f1778d3e285 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f1778d3fb9b in __GI_abort () at abort.c:91
#8  0x00007f1779614c5d in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#9  0x00007f1779612e16 in __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:40
#10 0x00007f1779612e43 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:50
#11 0x00007f1779612f86 in __cxxabiv1::__cxa_rethrow () at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:116
#12 0x00007f177f73c7fc in QEventLoop::exec (this=<optimized out>, flags=<optimized out>) at kernel/qeventloop.cpp:218
#13 0x00007f177f741225 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#14 0x00007f17804547f6 in Akonadi::ResourceBase::init (r=0x1424660) at /usr/src/debug/kdepimlibs-4.8.5/akonadi/resourcebase.cpp:412
#15 0x0000000000416626 in Akonadi::ResourceBase::init<CalendarResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/kde4/akonadi/resourcebase.h:188
#16 0x00007f1778d2969d in __libc_start_main (main=0x40dad0 <main(int, char**)>, argc=3, ubp_av=0x7fff303f09b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff303f09a8) at libc-start.c:226
#17 0x000000000040db01 in _start ()

Possible duplicates by query: bug 305946, bug 305584, bug 303616, bug 303599, bug 302555.

Reported using DrKonqi
Comment 1 Daniel Vrátil 2012-09-04 08:17:31 UTC
Resource that is not configured in Kontact is not running thus it cannot crash :) 

Could you please check your $HOME/.xsession-errors if there are any information about the crash You can search for a line similar to "KCrash: Application 'akonadi_googlecalendar_resource_6' crashing...", which will be followed by information about unhandled exception which caused the crash. It would really help me to track down what exactly happened.
Comment 2 kdebug 2012-09-04 12:47:10 UTC
Sure.

====================================================================
grep -n -A 20 akonadi_googlecalendar_resource_6 ~/.xsession-errors
431:Known subscriber "akonadi_googlecalendar_resource_6" subscribes again 
432-Database "akonadi" opened using driver "QMYSQL" 
433-Known subscriber "AkonadiAgentServer" subscribes again 
434-void Akonadi::NotificationSource::addClientServiceName(const QString&) Notification source "AkonadiAgentServer" now serving: (":1.52", ":1.54", ":1.51", ":1.53", ":1.56") 
435-Known subscriber "AkonadiAgentServer" subscribes again 
436-void Akonadi::NotificationSource::addClientServiceName(const QString&) Notification source "AkonadiAgentServer" now serving: (":1.52", ":1.54", ":1.51", ":1.53", ":1.56", ":1.57") 
437-Known subscriber "AkonadiAgentServer" subscribes again 
438-void Akonadi::NotificationSource::addClientServiceName(const QString&) Notification source "AkonadiAgentServer" now serving: (":1.52", ":1.54", ":1.51", ":1.53", ":1.56", ":1.57", ":1.55") 
439-Agent instance created in separate process. 
440-Known subscriber "AkonadiAgentServer" subscribes again 
441-Known subscriber "AkonadiAgentServer" subscribes again 
442-void Akonadi::NotificationSource::addClientServiceName(const QString&) Notification source "AkonadiAgentServer" now serving: (":1.52", ":1.54", ":1.51", ":1.53", ":1.56", ":1.57", ":1.55", ":1.61") 
443-kwalletd(2604)/kdeui (Wallet) KWalletD::setupDialog: Application ' "Google Calendars and Tasks" ' using kwallet without parent window! 
444-Agent instance created in separate process. 
445-Known subscriber "AkonadiAgentServer" subscribes again 
446-Agent instance created in separate process. 
447-Known subscriber "AkonadiAgentServer" subscribes again 
448-Agent instance created in separate process. 
449-Known subscriber "AkonadiAgentServer" subscribes again 
450-Database "akonadi" opened using driver "QMYSQL" 
451-Database "akonadi" opened using driver "QMYSQL" 
--
5345:akonadi_googlecalendar_resource_6(2712) KGoogle::AccessManagerPrivate::nam_replyReceived: Requested resource is forbidden. 
5346:akonadi_googlecalendar_resource_6(2712) KGoogle::AccessManagerPrivate::nam_replyReceived: "{
5347- "error": {
5348-  "errors": [
5349-   {
5350-    "message": "Forbidden"
5351-   }
5352-  ],
5353-  "code": 403,
5354-  "message": "Forbidden"
5355- }
5356-}
5357-" 
5358-Qt has caught an exception thrown from an event handler. Throwing
5359-exceptions from an event handler is not supported in Qt. You must
5360-reimplement QApplication::notify() and catch all exceptions there.
5361-
5362-Qt has caught an exception thrown from an event handler. Throwing
5363-exceptions from an event handler is not supported in Qt. You must
5364-reimplement QApplication::notify() and catch all exceptions there.
5365-
5366-terminate called after throwing an instance of 'Akonadi::PayloadException'
--
5370:Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_googlecalendar_resource_6" , discarding cached interface 
5371:void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_googlecalendar_resource_6" now serving: () 
5372:void Akonadi::NotificationSource::unsubscribe() "akonadi_googlecalendar_resource_6" 
5373-ProcessControl: Application '/usr/local/bin/akonadi_googlecalendar_resource' returned with exit code 253 (Unknown error)
5374:akonadi_googlecalendar_resource_6(14719)/libakonadi Akonadi::SessionPrivate::socketError: Socket error occurred: "QLocalSocket::connectToServer: Invalid name" 
5375:Known subscriber "akonadi_googlecalendar_resource_6" subscribes again 
5376-Object::connect: No such signal QTimeEdit::timeEdited(QTime)
5377-QLayout: Attempting to add QLayout "" to QGroupBox "", which already has a layout
5378-Known subscriber "kontact" subscribes again 
5379-plasma-desktop(2625)/plasma StatusNotifierItemSource::contextMenu: Could not find DBusMenu interface, falling back to calling ContextMenu() 
5380-plasma-desktop(2625)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application 
5381-AgentManager::removeAgentInstance: calling instance->quit() 
5382-PreprocessorManager::unregisterInstance( "akonadi_davgroupware_resource_0" ) 
5383-QProcess: Destroyed while process is still running.
5384-ProcessControl: Application '/usr/bin/akonadi_davgroupware_resource' stopped unexpectedly (Process crashed)
5385-Application '/usr/bin/akonadi_davgroupware_resource' crashed. No restart!
5386-Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_0" , discarding cached interface 
5387-void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_davgroupware_resource_0" now serving: () 
5388-void Akonadi::NotificationSource::unsubscribe() "akonadi_davgroupware_resource_0" 
5389-QString::arg: Argument missing: , rmsppu@gmail.com
5390-KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work 
5391-KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work 
5392-plasma-desktop(2625)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application 
5393-plasma-desktop(2625)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application 
5394-plasma-desktop(2625)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application 
5395-plasma-desktop(2625)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application 
--
6004:Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_googlecalendar_resource_6" , discarding cached interface 
6005:void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_googlecalendar_resource_6" now serving: () 
6006:void Akonadi::NotificationSource::unsubscribe() "akonadi_googlecalendar_resource_6" 
6007-QProcess: Destroyed while process is still running.
6008-ProcessControl: Application '/usr/bin/akonadi_davgroupware_resource' stopped unexpectedly (Process crashed)
6009-Application '/usr/bin/akonadi_davgroupware_resource' crashed. No restart!
6010-void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_davgroupware_resource_1" now serving: () 
6011-void Akonadi::NotificationSource::unsubscribe() "akonadi_davgroupware_resource_1" 
6012-Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_1" , discarding cached interface 
6013-QProcess: Destroyed while process is still running.
6014-ProcessControl: Application '/usr/bin/akonadi_davgroupware_resource' stopped unexpectedly (Process crashed)
6015-Application '/usr/bin/akonadi_davgroupware_resource' crashed. No restart!
6016-Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_2" , discarding cached interface 
6017-void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_davgroupware_resource_2" now serving: () 
6018-void Akonadi::NotificationSource::unsubscribe() "akonadi_davgroupware_resource_2" 
6019-QProcess: Destroyed while process is still running.
6020-ProcessControl: Application '/usr/local/bin/akonadi_googlecalendar_resource' stopped unexpectedly (Process crashed)
6021-Application '/usr/local/bin/akonadi_googlecalendar_resource' crashed. No restart!
6022-Application '/usr/bin/akonadi_agent_launcher' exited normally...
6023-Application '/usr/bin/akonadi_agent_launcher' exited normally...
6024-Application '/usr/bin/akonadi_agent_launcher' exited normally...
6025-Application '/usr/bin/akonadi_maildispatcher_agent' exited normally...
6026-Application '/usr/bin/akonadi_mixedmaildir_resource' exited normally...
================================================================

My "solution" was to:
        akondictl stop
        rm -f ~/.config/akonadi/*
        rm -f ~/.kde/share/config/ak*
        akonadictl start
Comment 3 Daniel Vrátil 2012-09-04 13:17:17 UTC
Thanks! That's very helpful.
Comment 4 Myriam Schweingruber 2012-09-06 21:28:27 UTC

*** This bug has been marked as a duplicate of bug 305584 ***