Ask / Submit
21

CalDAV calendar duplication

asked 2017-09-06 17:07:25 +0300

hook gravatar image

updated 2017-10-31 23:41:03 +0300

After I updated my Jolla 1 to 2.1.1.26 (Jämsänjoki) I am getting duplicated calendars again from CalDav.

Server-side I use Nextcloud stable (at the time of this writing 12.0.2).

This is particularly annoying since if I don’t tend to for more than a day (see below), what happens is that:

Original issue (2017-09-06)

  • the calendars and therefore entries in them accumulate (e.g. 5 copies of all calendars in 3 days), which also means that all the event alarms fire 5 times every time
  • every time caldav syncs it consumes a full CPU core for an unnatural amount of time, which also heats up the phone and eats up the battery like it’s free cookies
  • sometimes Calendar app crashes, but still consumes a full CPU core until I kill it through Lighthouse (or Terminal)
  • sometimes Calendar app shows a completely empty screen when clicking on an event to see its details.

The Google account is not affected by this bug on my install.

I tried to apply the following 1.x SailfishOS temporary fix and it just fixes things for a few hours and then the bug happens again

This seems similar to the 2.1.0.10 bug, but since sending longer comments messes up all layout and it is a new version, I decided to open up a new question instead.

Update 2017-09-08

I somehow managed to fix or work around the issue by:

  1. remove the CalDAV account
  2. kill msyncd (several times and also with -9 flag, just in case that bugger won’t stay dead)
  3. rm -rf /home/nemo/.local/share/system/privileged/Calendar/mkcal
  4. uninstall Calendar app from Store
  5. reboot
  6. re-install Calendar app from Store
  7. set up CalDAV account anew

For now it seems it is behaving itself, but no idea how long it lasts. I used to have syncing set up on hourly, but right now I have it set to twice a day, since I want the battery to survive at least daytime. Will turn it to hourly again now and if I don’t say otherwise, it behaved also when set to hourly.

Oddly enough, now the entries for both the CalDAV and Google calendars are singular (as they should be), but yesterday I got ~5 reminders in a row for the same Google calendar event. I will follow what @Ralf suggested and see if switching also Google’s calendars to CalDAV will fix that now.

If this fix turns out to work, I will copy it into an answer as well.

As requested by @damien-caliste, here is some more info – sadly only after I applied the above fix:

~/.cache/msyncd/sync/logs/caldav-sync-43.log.xml:

<?xml version="1.0" encoding="UTF-8"?>
<synclog name="caldav-sync-43">
    <syncresults time="2017-09-07T22:48:04Z" minorcode="0" scheduled="false" majorcode="0"/>
    <syncresults time="2017-09-07T22:48:39Z" minorcode="0" scheduled="false" majorcode="0"/>
    <syncresults time="2017-09-08T02:10:54Z" minorcode="0" scheduled="true" majorcode="0"/>
    <syncresults time="2017-09-08T02:10:54Z" minorcode="503" scheduled="false" majorcode="1"/>
    <syncresults time="2017-09-08T08:03:10Z" minorcode="0" scheduled="false" majorcode="0"/>
</synclog>

~/.local/share/system/privileged/Sync/caldav.ini:

[General]
13-cleaned=true
16-cleaned=true
20-cleaned=true
21-cleaned=true
22-cleaned=true
7-cleaned=true
24-cleaned=true
25-cleaned=true
28-cleaned=true
31-cleaned=true
32-cleaned=true
33-cleaned=tru
35-cleaned=true
36-cleaned=true
37-cleaned=true
39-cleaned=true
40-cleaned=true
41-cleaned=true
42-cleaned=true
43-cleaned=true

Output of sqlite3 ~/.config/libaccounts-glib/accounts.db "select * from Settings where account == 43;":

43|0|CredentialsId|u|44
43|0|CredentialsNeedUpdate|b|false
43|0|Jolla/segregated_credentials/Jolla|u|44
43|0|default_credentials_username|s|'hook'
43|0|enabled|b|true
43|0|name|s|'Juno'
43|19|CredentialsId|u|44
43|19|auth/mechanism|s|'password'
43|19|auth/method|s|'password'
43|19|caldav-sync/profile_id|s|'caldav-sync-43'
43|19|calendar_colors|as|['#ffffca', '#e7e774', '#e774ca']
43|19|calendar_display_names|as|['Rojstni dnevi kontaktov', 'Osebno', 'Dogodki']
43|19|calendars|as|['/remote.php/dav/calendars/hook/contact_birthdays/', '/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
43|19|enabled|b|true
43|19|enabled_calendars|as|['/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
43|19|ignore_ssl_errors|b|false
43|19|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
43|19|sync_profile_templates|as|['caldav-sync']
43|20|CredentialsId|u|44
43|20|auth/mechanism|s|'password'
43|20|auth/method|s|'password'
43|20|carddav.Contacts/profile_id|s|'carddav.Contacts-43'
43|20|enabled|b|true
43|20|ignore_ssl_errors|b|false
43|20|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
43|20|sync_profile_templates|as|['carddav.Contacts']

Update 2017-09-18

As of two or three days ago, the bug is back. It started with simply double entries and now grew up to six(!) copies of each calendar and entry.

So the above solution seems to temporarily solve the symptoms, but not the underlying issue.

Here is the info requested by @damien-caliste – this time on an actual bug-ridden device:

/home/nemo/.cache/msyncd/sync/logs/caldav-sync-43.log.xml

<?xml version="1.0" encoding="UTF-8"?>
<synclog name="caldav-sync-43">
    <syncresults minorcode="0" scheduled="true" time="2017-09-18T14:49:01Z" majorcode="0"/>
    <syncresults minorcode="15" scheduled="true" time="" majorcode="1"/>
    <syncresults minorcode="15" scheduled="true" time="" majorcode="1"/>
    <syncresults minorcode="15" scheduled="true" time="" majorcode="1"/>
    <syncresults minorcode="0" scheduled="true" time="2017-09-18T17:04:00Z" majorcode="0"/>
</synclog>

/home/nemo/.local/share/system/privileged/Sync/caldav.ini

[General]
13-cleaned=true
16-cleaned=true
20-cleaned=true
21-cleaned=true
22-cleaned=true
7-cleaned=true
24-cleaned=true
25-cleaned=true
28-cleaned=true
31-cleaned=true
32-cleaned=true
33-cleaned=true
35-cleaned=true
36-cleaned=true
37-cleaned=true
39-cleaned=true
40-cleaned=true
41-cleaned=true
42-cleaned=true
43-cleaned=true

Output of sqlite3 /home/nemo/.config/libaccounts-glib/accounts.db "select * from Settings where account == 43;"

43|0|CredentialsId|u|44
43|0|CredentialsNeedUpdate|b|false
43|0|Jolla/segregated_credentials/Jolla|u|44
43|0|default_credentials_username|s|'hook'
43|0|enabled|b|true
43|0|name|s|'Juno'
43|0|provider-available|b|true
43|19|CredentialsId|u|44
43|19|auth/mechanism|s|'password'
43|19|auth/method|s|'password'
43|19|caldav-sync/profile_id|s|'caldav-sync-43'
43|19|calendar_colors|as|['#ffffca', '#e7e774', '#e774ca']
43|19|calendar_display_names|as|['Rojstni dnevi kontaktov', 'Osebno', 'Dogodki']
43|19|calendars|as|['/remote.php/dav/calendars/hook/contact_birthdays/', '/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
43|19|enabled|b|true
43|19|enabled_calendars|as|['/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
43|19|ignore_ssl_errors|b|false
43|19|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
43|19|sync_profile_templates|as|['caldav-sync']
43|20|CredentialsId|u|44
43|20|auth/mechanism|s|'password'
43|20|auth/method|s|'password'
43|20|carddav.Contacts/profile_id|s|'carddav.Contacts-43'
43|20|enabled|b|true
43|20|ignore_ssl_errors|b|false
43|20|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
43|20|sync_profile_templates|as|['carddav.Contacts']

Update 2017-10-09

As expected, a few days ago it happened again – started with double entries and by now we’re at five.

Here is the info requested by @damien-caliste – this time hopefully all the bits he needs:

/home/nemo/.cache/msyncd/sync/logs/caldav-sync-51.log.xml

<?xml version="1.0" encoding="UTF-8"?>
<synclog name="caldav-sync-51">
    <syncresults majorcode="1" time="" minorcode="15" scheduled="true"/>
    <syncresults majorcode="0" time="2017-10-09T20:42:54Z" minorcode="0" scheduled="true"/>
    <syncresults majorcode="1" time="" minorcode="15" scheduled="true"/>
    <syncresults majorcode="0" time="2017-10-09T22:07:54Z" minorcode="0" scheduled="true"/>
    <syncresults majorcode="0" time="2017-10-09T22:32:56Z" minorcode="0" scheduled="true"/>
</synclog>

/home/nemo/.local/share/system/privileged/Sync/caldav.ini

[General]
13-cleaned=true
16-cleaned=true
20-cleaned=true
21-cleaned=true
22-cleaned=true
7-cleaned=true
24-cleaned=true
25-cleaned=true
28-cleaned=true
31-cleaned=true
32-cleaned=true
33-cleaned=true
35-cleaned=true
36-cleaned=true
37-cleaned=true
39-cleaned=true
40-cleaned=true
41-cleaned=true
42-cleaned=true
43-cleaned=true
51-cleaned=true

sqlite3 /home/nemo/.config/libaccounts-glib/accounts.db "select * from Settings where account == 51;"

51|0|CredentialsId|u|52
51|0|CredentialsNeedUpdate|b|false
51|0|Jolla/segregated_credentials/Jolla|u|52
51|0|default_credentials_username|s|'hook'
51|0|enabled|b|true
51|0|name|s|'Juno'
51|19|CredentialsId|u|52
51|19|auth/mechanism|s|'password'
51|19|auth/method|s|'password'
51|19|caldav-sync/profile_id|s|'caldav-sync-51'
51|19|calendar_colors|as|['#ffffca', '#e7e774', '#e774ca']
51|19|calendar_display_names|as|['Rojstni dnevi kontaktov', 'Osebno', 'Dogodki']
51|19|calendars|as|['/remote.php/dav/calendars/hook/contact_birthdays/', '/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
51|19|enabled|b|true
51|19|enabled_calendars|as|['/remote.php/dav/calendars/hook/personal/', '/remote.php/dav/calendars/hook/dogodki/']
51|19|ignore_ssl_errors|b|false
51|19|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
51|19|sync_profile_templates|as|['caldav-sync']
51|20|CredentialsId|u|52
51|20|auth/mechanism|s|'password'
51|20|auth/method|s|'password'
51|20|carddav.Contacts/profile_id|s|'carddav.Contacts-51'
51|20|enabled|b|true
51|20|ignore_ssl_errors|b|false
51|20|server_address|s|'https://thatfunkyplace.wheremymonkeyis.at'
51|20|sync_profile_templates|as|['carddav.Contacts']

sqlite3 /home/nemo/.local/share/system/privileged/Calendar/mkcal/db "SELECT * from Calendars;"

4b3448ba-ebb5-480e-93c7-385bf54f8b78|Default||#0000FF|151|0|||-1|1504967274|||1504707020||
b1376da7-5555-1111-2222-227549c4e570|Rojstni dnevi||#e00080|215|0|Birthday-Nokia||0|1506191528|||1504707082||
ee797756-c9a3-47bf-bcd9-53034ff16db9|Osebno||#e7e774|151|1507264357|caldav|51|-1|1507264357||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1506195439||
3aac2732-e14a-40de-aced-16c91d11c6ed|Dogodki||#e774ca|151|1507480376|caldav|51|-1|1507480394||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1506195439||
4b79e969-f181-4767-a889-5c06edf6c8cd|88282260@liferay.com||#7bd148|151|0|google-88282260@liferay.com|53|-1|1506894431|||1506894431||
04d701ca-b32a-4c9f-9791-bb75f2a65410|Osebno||#e7e774|151|1507588398|caldav|51|-1|1507588398||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507282096||
e9310f5c-e612-49a0-b20d-74590cabe006|Dogodki||#e774ca|151|1507586881|caldav|51|-1|1507586907||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507282096||
f1c67f79-5188-4da2-b5f1-bbfa2ae4c9d0|Osebno||#e7e774|151|1507297081|caldav|51|-1|1507297082||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507297081||
dfea5f97-5f83-437f-824f-bb6c699cf4f7|Dogodki||#e774ca|151|1507527179|caldav|51|-1|1507527198||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507297082||
378f6867-2d61-48fb-aaae-97953e4aa6a1|Osebno||#e7e774|151|1507540099|caldav|51|-1|1507540099||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507505604||
c6e07153-3f0c-4551-8652-a33d6d344a8e|Dogodki||#e774ca|151|1507540077|caldav|51|-1|1507540099||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507505604||
085eef08-1ca0-48e2-8bb7-db48a24b27fd|Osebno||#e7e774|151|1507530799|caldav|51|-1|1507530799||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507526903||
65957649-1b70-4f77-a3dd-5ed1b60abb59|Dogodki||#e774ca|151|1507588390|caldav|51|-1|1507588398||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507526903||
23450495-4632-4069-b98c-7ae73947a345|Osebno||#e7e774|151|1507586906|caldav|51|-1|1507586906||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507559614||
9960aa3e-a0d1-49ed-b1e9-401c876e3bdb|Dogodki||#e774ca|151|1507559588|caldav|51|-1|1507559615||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507559615||
c7a3dfb3-a55d-4c53-b5f0-a6d88e57ccc8|Osebno||#e7e774|151|1507576410|caldav|51|-1|1507576410||caldav-sync-51:/remote.php/dav/calendars/hook/personal/|1507576410||
b4037bac-0c1a-4616-a5fc-b404f175baab|Dogodki||#e774ca|151|1507576386|caldav|51|-1|1507576410||caldav-sync-51:/remote.php/dav/calendars/hook/dogodki/|1507576410||

Update 2017-10-29

The bug persists in 2.1.2.3 (Kiiminkijoki) – moved the afflicted version(s) into the tags.


P.S. Kudos for making setting up CalDAV/CardDAV on SailfishOS easy though! :D

edit retag flag offensive close delete

Comments

2

May I ask you the content of ~/.cache/msyncd/sync/logs/caldav-sync-xx.log.xml ? You need to devel-su -p first because this file is under restricted priviledge access. Replace the xx in the file name with the number of your account (well the id that the phone gave to your CalDAV account, which you don't know, but there should not be so many caldav-sync-xx.log.xml files anyway).

Damien Caliste ( 2017-09-06 18:07:03 +0300 )edit
1

Besides, it's taking a lot of time to sync because it is retrieving the full calendar content each time. There are two reasons for this:

  • the log.xml file contains no successful sync date ;
  • or the file in ~/.local/share/system/privileged/Sync/caldav.ini is telling for a strange reason to erase your calendar each time (but I don't think so because you won't see the duplication then).

Or there are some other reasons I don't know (yet).

Damien Caliste ( 2017-09-06 18:12:10 +0300 )edit
1

I see a third reason, if the buteo plugin cannot match the syncProfile of the calendar in mkcal db with the path registered in the account db. To know this, after typing devel-su -p, can you give the output of these two commands:

  • sqlite3 .local/share/system/privileged/Calendar/mkcal/db "SELECT * from Calendars;"
  • sqlite3 ~/.config/libaccounts-glib/accounts.db "select * from Settings where account == xx;"

You need to put the account number in the second command instead of xx. This is one field of the first command, the one after caldav string. You can remove the personal information from the second command. The specific setting of interest is only the 'calendars' one with the paths as values. The path in the syncProfile of the first command must coincide with the path in the second command otherwise there will be a duplication.

Damien Caliste ( 2017-09-06 19:26:02 +0300 )edit
2

Hello - I use this workaround and have no problems - is only a tip if the other solutions not work. I have also 2.1.1.26 and a Google account with inactive calendar sync and a caldav account for the Google calendar.

https://together.jolla.com/question/162657/google-calendar-not-syncing-new-events/?comment=166617#comment-166617

Maybe it helps - delete the old account and the calendar will clean. Reboot and follow my lines.

Ralf ( 2017-09-06 19:52:53 +0300 )edit

I also had this problem with dublicates (more than 6 per event) my gmx calendar. In my case was it the sync between Outlook and gmx. I used Outlook CalDav from here. Have you also additional sync or only jolla to google? If yes tomorrow I can send you my settings from CalDav for Outlook. Tomorrow because it is on my notebook at work.

Ralf ( 2017-09-18 21:51:27 +0300 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-11-06 19:46:22 +0300

TomC gravatar image

Related issue/bug: https://together.jolla.com/question/172859/duplicate-caldav-events-in-jolla-1-after-sync-to-xperia/

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
9 followers

Stats

Asked: 2017-09-06 17:07:25 +0300

Seen: 809 times

Last updated: Nov 06 '17