Bug 461400 - Kmail stays offline after wakeup from suspend to ram
Summary: Kmail stays offline after wakeup from suspend to ram
Status: RESOLVED DUPLICATE of bug 421267
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.21.2
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-04 07:03 UTC by T Zachmann
Modified: 2024-01-29 19:57 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description T Zachmann 2022-11-04 07:03:02 UTC
SUMMARY
***
KMail (IMAP and mail transport agent) stay offline after suspend to RAM
***


STEPS TO REPRODUCE
1. Start Kmail reveiving mail and sending mail works
2. Suspend computer to ram (Sleep)
3. Wake up computer

OBSERVED RESULT

KMail stays offline

EXPECTED RESULT

KMail should become online automatically

SOFTWARE/OS VERSIONS
Current newly install kde neon
KMail: Version 5.21.2 (22.08.2)
KDE Frameworks Version: Version 5.99.0
Qt Version: Version 5.15.6 (built against 5.15.6)

ADDITIONAL INFORMATION

KMail offers to go online when I try to send a mail but that does not work. To make sending mail again work I need to restart Mail Dispatcher Agent in the akonadi console. Toggle Online/Offline does not work.

Imap2 I can get to online again by Restart Account in the popup menu of the imap account
Comment 1 Louis Moureaux 2023-01-10 15:46:03 UTC
I was affected by the same issue, however I can no longer reproduce since I upgraded to KMail 5.22.1 (Frameworks 5.101). Could you please confirm that you still see the bug in the new version?

I'm setting this bug as NEEDSINFO/WAITINGFORINFO; please set it back to REPORTED if you can still reproduce with the new version, or RESOLVED/FIXED otherwise.
Comment 2 Torsten Bielen 2023-01-13 17:57:22 UTC
I use kde neon. 
KDE Frameworks 5.101.0
QT 5.15.8
Kontakt 5.22.1 (22.12.1)

I can confirm the behavior is the same as in the ticket described. The system stays offline after suspending and restarting.
Comment 3 IFriendly 2023-01-26 11:51:46 UTC
KDE Neon (5.26) on (22.04)
Plasma 5.26.5
Framework 5.102.0
Qt 5.15.8
Kmail(22.12.1)
KOrganazer (22.12.1)


Can confirm suspend issue.

+ in other cases when network was unavailable with time greater than imap or calDAV/cardDAV(davgroupware agents) sync-time.
This issue applicable for network resources only and others that dependent from them:
akonadi_sendlater_agent
akonadi_followupreminder_agent
akonadi_mailmerge_agent
akonadi_maildispatcher_agent

Manual restart network-dependent agents solve the problem.
Comment 4 IFriendly 2023-01-26 15:52:26 UTC
akonadictl

outputs:

"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/6”"
Comment 5 IFriendly 2023-02-05 17:16:42 UTC
Update 5.22.2 (22.12.2) was installed today (akonadi agents was updated) but issue still present.

akonadictl says:

Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”


and akonadi network agents (WebDAV/CalDAV, IMAP,..) remain disconnected (offline) after network connection is restored.
Comment 6 Alej 2023-02-22 20:52:00 UTC
I can confirm this bug in:

Kmail Versión 5.22.2 (22.12.2)

Plasma Desktop 5.27.1

KDE Frameworks Versión 5.103.0

Qt Versión 5.15.8 (compilado con 5.15.8)

In KDE Neon  5.27.1 (22.04 Jammy)

Still KMail and Updates keeps offline after wake up from sleep.
Comment 7 Ray 2023-02-23 18:42:28 UTC
Same here, closing kontact/kmail and akonadictl restart brings it back online.

"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/"

Has anybody tried a KDE Neon fresh install (not upgraded to stable from Beta or RC state)?
Comment 8 Ray 2023-02-23 18:46:32 UTC
Does this give us a hint maybe?
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010576
Comment 9 Ray 2023-02-23 21:05:33 UTC
(In reply to Ray from comment #7)
> Same here, closing kontact/kmail and akonadictl restart brings it back
> online.
> 
> "Object does not exist at path
> “/org/freedesktop/NetworkManager/ActiveConnection/"
> 
> Has anybody tried a KDE Neon fresh install (not upgraded to stable from Beta
> or RC state)?

same with fresh installed KDE Neon
Comment 10 IFriendly 2023-02-23 22:46:10 UTC
(In reply to Ray from comment #8)
> Does this give us a hint maybe?
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010576

No error in syslog or another apparmor logs. Seems it's OK.

But after resume syslog said:

Feb 24 00:06:16 homepc kded5[1342]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc plasmashell[1429]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_mailmerge_agent[33232]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_followupreminder_agent[33206]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_sendlater_agent[33269]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_maildispatcher_agent[33226]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_imap_resource[33210]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc goldendict[13897]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_davgroupware_resource[33205]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc DiscoverNotifier[1586]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc kdeconnectd[1557]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
Feb 24 00:06:16 homepc akonadi_imap_resource[33208]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"


So there are a lot of apps that waits for connection from d-bus
Not only akonadi but kded5, plasmashell, DiscoverNotifier, kdeconnectd,goldendict as well

And  DiscoverNotifier Icon in system tray shows "broken connection" icon.
May be it is not akonadi only issue?
Comment 11 Alej 2023-03-01 23:17:30 UTC
Confirm bug in plasma desktop 5.27.2

KDE Frameworks Versión 5.103.0
Qt versión 5.15.8 
Kmail 5.22.2 (22.12.2)
Comment 12 IFriendly 2023-03-03 20:13:52 UTC
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8


Issue still present
Comment 13 IFriendly 2023-03-14 22:09:38 UTC
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-35-generic (64-bit)
Graphics Platform: X11

Issue still here.
Comment 14 Ray 2023-03-16 19:05:27 UTC
nmcli general permissions


PERMISSION                                                        VALUE 
org.freedesktop.NetworkManager.checkpoint-rollback                auth  
org.freedesktop.NetworkManager.enable-disable-connectivity-check  yes   
org.freedesktop.NetworkManager.enable-disable-network             yes   
org.freedesktop.NetworkManager.enable-disable-statistics          yes   
org.freedesktop.NetworkManager.enable-disable-wifi                yes   
org.freedesktop.NetworkManager.enable-disable-wimax               yes   
org.freedesktop.NetworkManager.enable-disable-wwan                yes   
org.freedesktop.NetworkManager.network-control                    yes   
org.freedesktop.NetworkManager.reload                             auth  
org.freedesktop.NetworkManager.settings.modify.global-dns         auth  
org.freedesktop.NetworkManager.settings.modify.hostname           auth  
org.freedesktop.NetworkManager.settings.modify.own                yes   
org.freedesktop.NetworkManager.settings.modify.system             yes   
org.freedesktop.NetworkManager.sleep-wake                         no    
org.freedesktop.NetworkManager.wifi.scan                          yes   
org.freedesktop.NetworkManager.wifi.share.open                    yes   
org.freedesktop.NetworkManager.wifi.share.protected               yes   


maybe that's the problem???
Comment 15 Ray 2023-03-16 19:49:26 UTC
org.freedesktop.NetworkManager.sleep-wake                         no 
It's supposed to be that way - "put NetworkManager to sleep or wake it up (should only be used by system power management"
But probably system power management doesn't set this state?

Going offline (networkmanager) and online again makes akonadi and kmail think networkmanager is offline too
Comment 16 Ray 2023-03-16 19:55:18 UTC
nmcli connection up id "SSID"
DOES create /org/freedesktop/NetworkManager/ActiveConnection/ - but following a different number.
Akonadi was looking for /org/freedesktop/NetworkManager/ActiveConnection/4
but nmcli connection up id "SSID" created /org/freedesktop/NetworkManager/ActiveConnection/6
Comment 17 IFriendly 2023-03-18 14:58:23 UTC
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-35-generic (64-bit)
Graphics Platform: X11

Fail confirmed

Below is a small test case and the corresponding logs

==========
Transition state is:
[Connected]->/org/freedesktop/NetworkManager/ActiveConnection/2 ->[Disconnect]-> /org/freedesktop/NetworkManager<No_any_suffix_path>-> [Connect]->/org/freedesktop/NetworkManager/ActiveConnection/3

==========
Respective log is:

[Connected]
...
[Disconnect]
[2023-03-18T12:46:17.883Z] akonadi_imap_resource default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.883Z] akonadi_imap_resource org.kde.pim.imapresource online= false
[2023-03-18T12:46:17.883Z] akonadi_maildispatcher_agent default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.884Z] plasmashell default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
[2023-03-18T12:46:17.884Z] kmail default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
[2023-03-18T12:46:17.884Z] akonadi_davgroupware_resource default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.884Z] akonadi_imap_resource default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.884Z] akonadi_sendlater_agent default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.885Z] akonadi_imap_resource org.kde.pim.imapresource online= false
[2023-03-18T12:46:17.886Z] akonadi_mailmerge_agent default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.884Z] akonadi_followupreminder_agent default "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
[2023-03-18T12:46:17.886Z] akonadi_maildispatcher_agent org.kde.pim.maildispatcher Offline.
[2023-03-18T12:46:17.887Z] akonadi_davgroupware_resource org.kde.pim.davresource Resource changed online status to false

<Next piece of logs does not corresponded to akonadi but may be useful >
[2023-03-18T12:46:18.636Z] plasmashell default file:///home/user/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/AgendaEventItem.qml:26:2: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[2023-03-18T12:46:18.132Z] plasmashell default Could not find the Plasmoid for Plasma::FrameSvgItem(0x55bfaad80360) QQmlContext(0x55bfa5a1eec0) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
[2023-03-18T12:46:18.132Z] plasmashell default Could not find the Plasmoid for Plasma::FrameSvgItem(0x55bfaad80360) QQmlContext(0x55bfa5a1eec0) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
[2023-03-18T12:46:18.524Z] plasmashell default file:///home/user/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/AgendaEventItem.qml:26:2: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
.......
[2023-03-18T12:46:18.636Z] plasmashell default file:///home/user/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/AgendaEventItem.qml:26:2: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }

[2023-03-18T12:46:18.921Z] akonadi_imap_resource org.kde.pim.kimap Received BYE:  "logging out "
[2023-03-18T12:46:18.921Z] akonadi_imap_resource org.kde.pim.kimap close
[2023-03-18T12:46:18.921Z] akonadi_imap_resource org.kde.pim.kimap close
[2023-03-18T12:46:18.950Z] akonadi_imap_resource org.kde.pim.kimap close
[2023-03-18T12:46:18.950Z] akonadi_imap_resource org.kde.pim.kimap Received BYE:  "logging out "
[2023-03-18T12:46:18.950Z] akonadi_imap_resource org.kde.pim.kimap close
[2023-03-18T12:46:19.041Z] akonadi_imap_resource org.kde.pim.kimap Received BYE:  "Logging out "
[2023-03-18T12:46:19.041Z] akonadi_imap_resource org.kde.pim.kimap Received BYE:  "Logging out "

[Connect]
[2023-03-18T12:46:22.062Z] plasmashell default file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/extras/PlaceholderMessage.qml:238:5: QML Heading: Binding loop detected for property "verticalAlignment"
[2023-03-18T12:46:18.636Z] plasmashell default file:///home/user/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/AgendaEventItem.qml:26:2: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
...
<No logs for akonadi server inbound notification from dbus>

==========
I've tested akonadi on the old (20.04) KDE Neon (info below) but there is no problem with disconnect/connect notification to akonadiserver. Logs are different from 22.04 and seems that akonadiserver received network change notifications. Agents immediately change their statuses (online/offline) when network status changes.

Operating System: KDE neon 5.26
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Kernel Version: 5.15.0-58-generic (64-bit)
Graphics Platform: X11

I can post them here if it'll help to solve the issue
Comment 18 Alej 2023-03-18 15:57:07 UTC
Still present in recent update 5.27.3
KDE Neon 5.27 (22.04  jammy)
Comment 19 Ray 2023-03-22 11:31:31 UTC
Seems to be resolved?! I don't know what did it though
i'm on 5.27.3 (22.03.)
can someone confirm?
Comment 20 Ray 2023-03-22 11:46:11 UTC
(In reply to Ray from comment #19)
> Seems to be resolved?! I don't know what did it though
> i'm on 5.27.3 (22.03.)
> can someone confirm?

sorry - somehow it worked once, but doesn't anymore. Don't know why. I changed network connections very often today, maybe it has something to do with that
Comment 21 Alej 2023-03-22 11:54:28 UTC
(In reply to Ray from comment #19)
> Seems to be resolved?! I don't know what did it though
> i'm on 5.27.3 (22.03.)
> can someone confirm?

The bug still present in  5.27.3 (22.03.). KDE Neon stable
Comment 22 Alej 2023-04-07 00:28:02 UTC
Bug still present in 5.27.4
Comment 23 Alej 2023-04-08 23:40:51 UTC
Ok since it seems this is going to be a long wait, I solved this problem disabling NetworkManager and installing another NM. I installed cmst and connman and work just fine. The laptop suspend and wake up and everything works (Kmail, Updates, etc) just it should.

Cheers
Comment 24 IFriendly 2023-04-13 20:10:25 UTC
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.8

Issue still present
Comment 25 Ray 2023-04-15 19:11:05 UTC
I was on suspend a couple of times, and akonadi/kmail is still working. Is this just a coicidence?

Operating System: KDE neon 5.27.4
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.8
Comment 26 IFriendly 2023-04-15 20:53:30 UTC
(In reply to Ray from comment #25)
> I was on suspend a couple of times, and akonadi/kmail is still working. Is
> this just a coicidence?
> 

Try to do following:
1) restart all akonadi agents via $akonadictl restart
2) run kmail and check that all accounts is online
3) switch OFF wifi or another active network connection. Wait for a minute. 
4) switch ON wifi or another active network connection again. Check any network resource for accessibility.  
5) check kmail accounts for online status. Or try to switch them into online mode.
Results:
kmail accounts are still in offline mode. Accounts will be offline until you run "$akonadictl restart" and manually set them in online.

You may also use akonadiconsole GUI app to check all akonadi agents status.
In ideal (based on 20.04) all network dependant  agents should immediately change their statuses when network status changed (connected or disconnected) via dbus.
Comment 27 ajvogel 2023-04-16 05:48:22 UTC
Can confirm issue still exists on KDE Neon (22.04) with all latest updates applied.
Comment 28 IFriendly 2023-04-21 15:48:40 UTC
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 5.19.0-40-generic (64-bit)

Issue still here
Comment 29 ioo+kde 2023-05-11 19:14:21 UTC
This bug is still present the Welcome to KMail 5.23.1 (23.04.1)

I have to use the akonadiconsole everytime I wake up from sleep to check my mail. I can confirm it isn't just mailboxes for all resources. My notes and to do items do not sync either.

Kmail always shows this:
"no network connection detected, all network jobs are suspended"

In the status bar at the bottom. I think this is a VERY old bug:

https://bugs.kde.org/show_bug.cgi?id=310694
Comment 30 ioo+kde 2023-05-11 19:40:27 UTC
This is what I see in the logs when I resume from sleep:

May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/5”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/4”"
May 11 15:19:39 host akonadi_imap_resource[24567]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_imap_resource[24573]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host kontact[24211]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_notes_agent[24621]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_followupreminder_agent[24549]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_mailmerge_agent[24603]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_etesync_resource[24540]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_maildispatcher_agent[24592]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
May 11 15:19:39 host akonadi_sendlater_agent[24622]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"


The only way I can check my mail, sync my notes and  calendar etc is to use the akonadiconsole to restart each resource each time I resume from sleep. It is quite tedious and it means that nothing syncs until I have manually brought it online.

The Kontact apps are the only ones affected, everything else works when resuming from sleep.

This problem has persisted for me on and off for two or three years. It was fixed for quite a while but unfortunately it came back recently when upgrading to KDE 5.27.
Comment 31 Moritz 2023-05-11 19:49:47 UTC
It is not only kmail specific, it is also happening to caldav and card dav resources.
Comment 32 ioo+kde 2023-05-11 20:50:50 UTC
(In reply to Moritz from comment #31)
> It is not only kmail specific, it is also happening to caldav and card dav
> resources.

Yes I can confirm this, for me it is every Akonadi resource so mailboxes, calendars, reminder agents, notifiers, mail dispatch agents, notes, card and cal dav etc. Its a real pain because I have to manually start each resource every time resuming from sleep then for mail I have to manually update the mailboxes.

Its been broken like this on and off for years. I'm surprised the issue has persisted this long.
Comment 33 ioo+kde 2023-05-11 20:57:36 UTC
To followup on my last post where I pasted the errors from the syslogs. This is what I have found:

Akonadi is trying to look at /ActiveConnection/3, /ActiveConnection/4 and /ActiveConnection/5 but the actual connection is from 'nmcli connection show connectionName' is:

GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/22

So why is akonadi looking at a phantom active connection to determine the network status? This would explain why it never comes online when resuming from sleep, because these active connection don't exist. Where does it get this active connection from and how can I set it to look at the correct current active connection?

AI chatbot suggest creating a --user systemd service and running akonadictl restart when the computer resumes from sleep however this only fixes half the problem because I would still have to manually update the mailboxes by right clicking and selecting "Update this folder..." as these mailboxes remain offline even after doing a akonadictl restart.

It would be nice to address the root cause of this issue, if someone knows where akonadi gets those wrong D-Bus object paths from.
Comment 34 Ray 2023-05-12 05:14:04 UTC
bug is still killing my nerves on 5.27.5
Comment 35 ioo+kde 2023-05-12 15:21:05 UTC
(In reply to Ray from comment #16)
> nmcli connection up id "SSID"
> DOES create /org/freedesktop/NetworkManager/ActiveConnection/ - but
> following a different number.
> Akonadi was looking for /org/freedesktop/NetworkManager/ActiveConnection/4
> but nmcli connection up id "SSID" created
> /org/freedesktop/NetworkManager/ActiveConnection/6

You isolated the bug back in May, what you wrote above is exactly the cause of the problem. Akonadi is looking at the wrong active connection. So it will always try to come online and always fail.

Why has no developer even look at this? If your search the forum you can find a dozen open bug reports describing this bug going back 11 years. Its a pretty critical bug, negatively affects many users and has 140 votes. Now the problem has been now well defined for months. Are there no Kontact developers working on this project? Is email and calendar functionality not a priority in KDE?
Comment 36 IFriendly 2023-05-12 16:53:51 UTC
>This problem has persisted for me on and off for two or three years. It was fixed for quite a while but unfortunately it came back recently when upgrading to KDE 5.27.

I've tested akonadi on the old (20.04) KDE Neon (info below) but there is no problem with disconnect/connect notification to akonadiserver. Logs are different from 22.04 and seems that akonadiserver received network change notifications. Agents immediately change their statuses (online/offline) when network status changes.

Operating System: KDE neon 5.26
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0

>...running akonadictl restart when the computer resumes from sleep 
This will not solve the problem.  Akonadi loose d-bus events when any network status changed (reconnect).

With addition to akonadi resources seems  Discover plasmoid (update notifier) also fails after Network reconnects.
Comment 37 Ray 2023-05-12 20:44:42 UTC
how about trying the matrix developer-channel? - I know, it's not a support channel, but it looks like no dev is watching this thread
Comment 39 Ray 2023-05-14 10:28:13 UTC
It looks like we've found a workaround.
Installing network-manager from lunar repository does the trick
Here you can read why this works: https://discuss.kde.org/t/on-kde-neon-kmail-and-whole-akonadi-stays-offline-after-suspend-or-when-reestablishing-a-network-connection/1425/5
Comment 40 ioo+kde 2023-05-15 03:00:28 UTC
(In reply to Ray from comment #39)
> It looks like we've found a workaround.
> Installing network-manager from lunar repository does the trick
> Here you can read why this works:
> https://discuss.kde.org/t/on-kde-neon-kmail-and-whole-akonadi-stays-offline-
> after-suspend-or-when-reestablishing-a-network-connection/1425/5

I am hesitant to try this. Can anyone else confirm this works, is there possibly a better solution or is this as good as we can expect at this point?
Comment 41 Moritz 2023-05-15 13:47:55 UTC
I can confirm, that made it work (I used the packages from debian sid, version 1.42.4-1 amd64)
Comment 42 ioo+kde 2023-05-15 20:23:51 UTC
I do not expect this bug will get addressed soon.

I have been trying a work around of trying to automate the task by runing akonadictl from the systemd sleep script when the laptop resumes from sleep from here: /usr/lib/systemd/system-sleep/.

It is no easy task, I cannot find a way to run the process so that it attaches to the current user session. I have tried exporting several environmental variables but akonadi always crashes or reports that it is not started. I think I need the DBUS_SESSION_BUS_ADDRESS but it isn't easy to get.

Has anyone else tried a similar workaround?
Comment 43 Moritz 2023-05-18 17:31:53 UTC
No, even after upgrading network-manager, my caldav calendar is offline again.
Comment 44 Alej 2023-05-18 17:41:23 UTC
I can confirm Moritz that upgrading network-manager to lunar repos don't resolve the issue. My kmail, update, etc etc all are offline after wakeup from sleep.
System KDE neon 5.27.5
Comment 45 Ray 2023-05-19 19:08:00 UTC
are you sure you restarted networkmanager and kde pim after installing lunars networkmanager? I've tested in on 2 machines, and it's woking since then.
Comment 46 IFriendly 2023-07-20 10:35:07 UTC
The issue still present.

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 5.19.0-46-generic (64-bit)
Graphics Platform: X11
Comment 47 PK 2023-10-13 17:46:42 UTC
(In reply to ioo+kde from comment #42)
> I do not expect this bug will get addressed soon.
> 
> I have been trying a work around of trying to automate the task by runing
> akonadictl from the systemd sleep script when the laptop resumes from sleep
> from here: /usr/lib/systemd/system-sleep/.
> 
> It is no easy task, I cannot find a way to run the process so that it
> attaches to the current user session. I have tried exporting several
> environmental variables but akonadi always crashes or reports that it is not
> started. I think I need the DBUS_SESSION_BUS_ADDRESS but it isn't easy to
> get.
> 
> Has anyone else tried a similar workaround?

Not an easy task indeed! I tried all sorts of things but they all didn't work. Finally I looked in the folder /usr/lib/systemd/system-sleep/ and there is another file named "hdparm". In this file I find:

#!/bin/sh

case $1 in
  post)
    /usr/lib/pm-utils/power.d/95hdparm-apm resume
    ;;
esac

So now I copied this file change the name and changed the content to:

#!/bin/sh

case $1 in
  post)
    /usr/bin/akonadictl restart
    ;;
esac

I thought perhaps I found the golden key. But this also didn't work...
Comment 48 Ray 2023-10-13 18:36:47 UTC
believe it or not, but as I mentioned - upgrading networkmanager (from lunar) is a valid workaround. I've done this on several machines by now, other people who tried didn't restart networkmanager or their machines or something else.
But probably we should mention this on a developer channel, but I didn't dare to do that. What do you think?


It looks like we've found a workaround.
Installing network-manager from lunar repository does the trick
Here you can read why this works: https://discuss.kde.org/t/on-kde-neon-kmail-and-whole-akonadi-stays-offline-after-suspend-or-when-reestablishing-a-network-connection/1425/5
Comment 49 IFriendly 2023-10-13 22:30:43 UTC
>upgrading networkmanager (from lunar) is a valid workaround.
Can confirm that it works.

But issue still present.
You can see it if you do the following steps:  
- akonadictr restart 
- switch-off current connection in NetworkManager
<nothing happened in akonadictl>
- switch-on current connection in NetworkManager
<"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/7”>

Another way to check that the problem is still present is to change the connection status in NM, and see that no changes have occurred in the GUI of the Akonadi Console: disabling/enabling the network connection does not automatically affect the connection state of mail agents. But they must to change their own status right away because dbus notification send immediately to akonadi subscriber.
Comment 50 PK 2023-10-14 04:36:55 UTC
(In reply to Ray from comment #48)
> believe it or not, but as I mentioned - upgrading networkmanager (from
> lunar) is a valid workaround. I've done this on several machines by now,
> other people who tried didn't restart networkmanager or their machines or
> something else.
> But probably we should mention this on a developer channel, but I didn't
> dare to do that. What do you think?
> 
> 
> It looks like we've found a workaround.
> Installing network-manager from lunar repository does the trick
> Here you can read why this works:
> https://discuss.kde.org/t/on-kde-neon-kmail-and-whole-akonadi-stays-offline-
> after-suspend-or-when-reestablishing-a-network-connection/1425/5

I have done this, but in my case the lunar nm didn't help. I will try again.
But "akonadictl restart" in the console always works on my system. 100% reproducible.
Comment 51 PK 2023-10-14 05:08:00 UTC
To elaborate on my comment 47 some more... On my systems when coming out of sleep, kmail says it is "offline" and it won't send email. Now when I give in the konsole: akonadictl start, then akonadi says: I am already running.
But, when I give in the konsole the command: akonadictl restart, then, after a short time kmail works as it should. On my systems this is 100% reproducible.
So that is why I though putting this command in a file in the folder /usr/lib/systemd/system-sleep/ , as I also describe in comment 47, but for reasons I do not understand, this doesn't work.
Comment 52 PK 2023-10-14 05:22:27 UTC
(In reply to Ray from comment #48)
> believe it or not, but as I mentioned - upgrading networkmanager (from
> lunar) is a valid workaround. I've done this on several machines by now,
> other people who tried didn't restart networkmanager or their machines or
> something else.
> But probably we should mention this on a developer channel, but I didn't
> dare to do that. What do you think?
> 
> 
> It looks like we've found a workaround.
> Installing network-manager from lunar repository does the trick
> Here you can read why this works:
> https://discuss.kde.org/t/on-kde-neon-kmail-and-whole-akonadi-stays-offline-
> after-suspend-or-when-reestablishing-a-network-connection/1425/5

I tried again and now your workaround works on my system too!
Thank you for finding this workaround and thank you for the accurate and easy help you gave...
Comment 53 ioo+kde 2023-10-14 18:25:50 UTC
I can also confirm that @Ray's solution does work. I implemented it a while ago and I have not had the issue since that time. Thank you Ray for the solution.
Comment 54 Aldoo 2024-01-08 15:42:55 UTC
Any news on this issue?
The fix seems to be known but Neon still has this faulty behavior as of today.
Comment 55 Andrew Shark 2024-01-29 19:57:16 UTC

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