Nextcloud account sync errors, local to remote. remote calendars sync both ways

REPRODUCIBILITY: 100%
OS VERSION: 4.5.0.19
HARDWARE: GS5/Vollax22
UI LANGUAGE: en_US
REGRESSION: Cannot recall.

DESCRIPTION:

Nextcloud syncing fails with the following in the journal:

Jun 01 11:54:51 Phone22 buteo-oopp-runner[17421]: [D] unknown:0 - Sending request: "GET" to: "davs://next.poetaster.de/ocs/v2.php/cloud/user" data: ""
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17418]: [D] unknown:0 - Sending request: "GET" to: "davs://next.poetaster.de/ocs/v2.php/cloud/capabilities" data: ""
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17421]: [W] unknown:0 - Nextcloud "nextcloud-images" sync for account 5 finished with error: "User info request failed (http
 status=0)"
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17421]: [C] unknown:0 - Nextcloud Images sync failed: Buteo::SyncResults::MinorCode(INTERNAL_ERROR) ""
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17418]: [W] unknown:0 - Nextcloud "nextcloud-posts" sync for account 5 finished with error: "Capabilities request failed (ht
tp status=0)"
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17418]: [C] unknown:0 - Nextcloud Posts sync failed: Buteo::SyncResults::MinorCode(INTERNAL_ERROR) ""
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - The "PROPFIND" operation failed with error: QNetworkReply::NetworkError(ProtocolUnknownError)
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - "PROPFIND" request failed. Buteo::SyncResults::MinorCode(CONNECTION_ERROR) "Network request failed w
ith QNetworkReply::NetworkError: 301"
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - Cannot find the calendar root for this user, guess it from account.
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - The "PROPFIND" operation failed with error: QNetworkReply::NetworkError(ProtocolUnknownError)
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - "PROPFIND" request failed. Buteo::SyncResults::MinorCode(CONNECTION_ERROR) "Network request failed w
ith QNetworkReply::NetworkError: 301"
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - Cannot list calendars, fallback to stored ones in account.
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - The "REPORT" operation failed with error: QNetworkReply::NetworkError(ProtocolUnknownError)
Jun 01 11:54:51 Phone22 buteo-oopp-runner[17424]: [W] unknown:0 - "REPORT" request failed. Buteo::SyncResults::MinorCode(CONNECTION_ERROR) "Network request failed wit
h QNetworkReply::NetworkError: 301"

PRECONDITIONS:

A nextcloud server setup for syncing. This one is on linux (debian 11) version 24.
The name of the account may be an issue. It’s ‘poetaster.de
The setup on device is ‘standard’

STEPS TO REPRODUCE:

  1. Set up account at davs://next.poetaster.de/
  2. configure Nextcloud account with two way syncing
  3. try to sync

EXPECTED RESULT:

Files, Calendars, etc, syncing.

ACTUAL RESULT:

The error message above.

MODIFICATIONS:

Chum and Openrepos are installed, but this is the ‘stock’ device with no patches.
I have tried with the xperia 10iii yet.

ADDITIONAL INFORMATION:

  • Also tried https instead of davs.
  • rclone can sync to the same paths as are listed in the Nextcloud account settings.
  • CalDAV and CardDav setup seems to work to some extent (the calendars from nextcloud seen on jolla)

I need to check, but if my memory is good dav is not supported.

I just set up rclone to test and that works. so the standard paths for files work. I’ll check if webdav sync works with those account types.

Have you configured the service discovery urls on your Nextcloud web server (https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#service-discovery)?

Yes. I did. works with rclone and with vdirsync.

Whoever keeps promoting davs: needs to stop. It is not a known URI scheme, and plonking an s onto a known one does not make it “that, but with encryption”.

Either use https:, or dav://host:443.

Sigh, I get you, but I did try, in this order:

  • davs
  • https
  • http
  • dav

Service discovery worked fine for both:
rclone lsd remote:
vdirsyncer

hmmm. I’m using the combination of server:
https:// + next.poetaster.de

and paths for files as
/remote.php/dav/remote.php/dav/files/USER/

I’ll try some more variations.

Hah. Stranger and stranger. The nextcloud notifications show up on the phone, but syncing does not work. What in the world does that mean?
Ah, and the calendars from nextcloud are shown under Manage calendars. syncing does not have any effect.

Just to make sure, I disabled everything but calendar. It does seem like the phone talks to the server as the apache logs show on selecting sync in the SFOS calendar:

2a01:4f9:3a:2414::6 - poetaster.de [02/Jun/2023:09:30:22 +0300] "PROPFIND /remote.php/dav/files/poetaster.de HTTP/1.1" 207 2207 "-" "Mozilla/5.0"
2a01:4f9:3a:2414::6 - poetaster.de [02/Jun/2023:09:30:22 +0300] "PROPFIND /remote.php/dav/principals/users/poetaster.de/ HTTP/1.1" 207 2786 "-" "Mozilla/5.0"
2a01:4f9:3a:2414::6 - poetaster.de [02/Jun/2023:09:30:23 +0300] "PROPFIND /remote.php/dav/calendars/poetaster.de/ HTTP/1.1" 207 3300 "-" "Mozilla/5.0"
2a01:4f9:3a:2414::6 - poetaster.de [02/Jun/2023:09:30:24 +0300] "REPORT /remote.php/dav/calendars/poetaster.de/personal/ HTTP/1.1" 207 2297 "-" "Mozilla/5.0"

Looking on the phone with journalctl:

Jun 02 08:33:39 Phone22 dbus-daemon[2758]: dbus-daemon[2758]: [session uid=100000 pid=2758] Successfully activated service 'com.google.code.AccountsSSO.SingleSignOn'
Jun 02 08:33:39 Phone22 buteo-oopp-runner[19313]: [D] unknown:0 - Sending request: "GET" to: "https://next.poetaster.de/remote.php/dav/ocs/v2.php/cloud/capabilities" data: ""
...
Jun 02 08:33:42 Phone22 buteo-oopp-runner[19313]: [W] unknown:0 - Nextcloud "nextcloud-posts" sync for account 5 finished with error: "Capabilities request failed (ht
tp status=404)"
Jun 02 08:33:42 Phone22 buteo-oopp-runner[19313]: [C] unknown:0 - Nextcloud Posts sync failed: Buteo::SyncResults::MinorCode(INTERNAL_ERROR) ""

Hello @poetaster , to debug the failing calendar sync, can you run the following:

systemctl --user stop msyncd
devel-su -p
QT_LOGGING_RULES="*.debug=true" msyncd

Wait for msyncd to start, you can ignore most of the debug output. Then trigger a calendar sync via the account setting for instance.

The log is very verbose and long. Start from the end where the caldav plugin return an error to msyncd. If you want me to investigate, send me the full log.

To get back to normal operations, stop your command line msyncd and run as normal user systemctl --user start msyncd.

Thanks @dcaliste! I’ve got vdirsyncer running on the phone and just noted that although discovery works, it also has issues which look like some server side thing. Unfortunately I didn’t save every config change separately. sigh. But this is a usefull approach in any case! Thanks!

I forgot to specify:
Syncing FROM nextcloud works.
Syncing TO nextcloud does not work.

with QT logging on:

  1. create new event
  2. sync in calendar app:

``[D] unknown:0 - updating notebook “dea24d7a-a34b-41b6-9b94-0bad079586e9” “Personal” in database
[D] unknown:0 - void NotebookSyncAgent::finalize() “5”
[D] unknown:0 - bool NotebookSyncAgent::applyRemoteChanges() “5”
[D] unknown:0 - bool NotebookSyncAgent::updateIncidences(const QListReader::CalendarResource&) “5”
[D] unknown:0 - bool NotebookSyncAgent::deleteIncidences(KCalendarCore::Incidence::List) “5”
[D] unknown:0 - updated timezones in database
[D] unknown:0 - updating notebook “1af70443-516f-4abd-919f-7ea330a34626” “Contact birthdays” in database
[D] unknown:0 - void NotebookSyncAgent::finalize() “5”
[D] unknown:0 - bool NotebookSyncAgent::applyRemoteChanges() “5”
[D] unknown:0 - bool NotebookSyncAgent::updateIncidences(const QListReader::CalendarResource&) “5”
[D] unknown:0 - bool NotebookSyncAgent::deleteIncidences(KCalendarCore::Incidence::List) “5”
[D] unknown:0 - updated timezones in database
[D] unknown:0 - updating notebook “d1a9728b-323c-4347-a68f-30e9a0fd8bb8” “Tasks” in database
[D] unknown:0 - void NotebookSyncAgent::finalize() “5”
[D] unknown:0 - bool NotebookSyncAgent::applyRemoteChanges() “5”
[D] unknown:0 - bool NotebookSyncAgent::updateIncidences(const QListReader::CalendarResource&) “5”
[D] unknown:0 - bool NotebookSyncAgent::deleteIncidences(KCalendarCore::Incidence::List) “5”
[D] unknown:0 - updated timezones in database
[D] unknown:0 - updating notebook “b78abc49-1c5d-4441-86e5-c87861518a8f” “Deck: Personal” in database
[D] unknown:0 - void NotebookSyncAgent::finalize() “5”
[D] unknown:0 - bool NotebookSyncAgent::applyRemoteChanges() “5”
[D] unknown:0 - bool NotebookSyncAgent::updateIncidences(const QListReader::CalendarResource&) “5”
[D] unknown:0 - bool NotebookSyncAgent::deleteIncidences(KCalendarCore::Incidence::List) “5”
[D] unknown:0 - updated timezones in database
[D] unknown:0 - updating notebook “dfd41285-bc40-4b70-b469-5a83ed2593fe” “Deck: DWD client” in database
[D] unknown:0 - void NotebookSyncAgent::finalize() “5”
[D] unknown:0 - Calendar storage saved successfully after writing notebook changes!
[D] unknown:0 - “void CalDavClient::syncFinished(Buteo::SyncResults::MinorCode, const QString&)” :Entry
[D] unknown:0 - “void CalDavClient::clearAgents()” :Entry
[D] unknown:0 - “void CalDavClient::clearAgents()” :Exit, execution time: 0 ms
[D] unknown:0 - CalDAV sync succeeded! “”

There seem to be no errors?

But nothing shows on the nextcloud side. But making events on the other side succeeds.

@dcaliste

I do see errors on the nextcloud side (I had forgotten where the admin logs are :slight_smile:

Sabre\DAV\Exception\UnsupportedMediaType: Validation error in iCalendar: A calendar object on a CalDAV server may only have components with the same UID.

EDIT: that error was from trying to vdirsync the ‘entire’ calendar ics file (with a local .caldendars/personal). The sync attempts from the phone’s calendar don’t generate errors in the logs.

Further up in the logs, after getting the etags of every incidences on the server, there is a line specifying how many changes are done locally. The debug line starts with “upsyncing local changes:” (if any local changes, otheriwse it may be “no local changes to upsync” or “Not upsyncing local changes”). Do you have it ? What are then the response of the server for every PUT ?

Sync process completes sucessfully but there may be non blocking error per incidence.

I just did another new event sync and noted the following right of the top:

``[D] unknown:0 - loaded notebook “b1376da7-5555-1111-2222-227549c4e570” “Birthdays” from database
[D] unknown:0 - loaded notebook “1af70443-516f-4abd-919f-7ea330a34626” “Contact birthdays” from database
[D] unknown:0 - loaded notebook “d53c4493-e448-482a-890f-35e10de031c1” “Contact birthdays” from database
[D] unknown:0 - loaded notebook “dfd41285-bc40-4b70-b469-5a83ed2593fe” “Deck: DWD client” from database
[D] unknown:0 - loaded notebook “0f1f1151-efdd-435c-9f0b-f2cd494e438c” “Deck: DWD client” from database
[D] unknown:0 - loaded notebook “b78abc49-1c5d-4441-86e5-c87861518a8f” “Deck: Personal” from database
[D] unknown:0 - loaded notebook “e9b4c900-18fa-456d-8891-099d63f24cb5” “Deck: Personal” from database
[D] unknown:0 - loaded notebook “20e65251-bc72-4c52-8157-2eebd449ceb9” “Default” from database
[D] unknown:0 - loaded notebook “dea24d7a-a34b-41b6-9b94-0bad079586e9” “Personal” from database
[D] unknown:0 - loaded notebook “f2254417-b7bd-4d4f-83fa-e6216b1d1669” “Personal” from database
[D] unknown:0 - loaded notebook “d1a9728b-323c-4347-a68f-30e9a0fd8bb8” “Tasks” from database
[D] unknown:0 - loaded notebook “38ca44b2-a608-4928-8a47-aeaa2794c498” “Tasks” from database

That duplication doesn't look right?
`

Followed this with:
* Turned off all calendars but Personal
* add new event
* sync

The existing cals are recoginzed and this reported:
```[D] unknown:0 - "---------------------------------------------------------------------"
[D] unknown:0 - Already existing calendar: "/remote.php/dav/calendars/poetaster.de/personal/" "Personal" "#0082c9"
[D] unknown:0 - Already existing calendar: "/remote.php/dav/calendars/poetaster.de/contact_birthdays/" "Contact birthdays" "#E9D859"
[D] unknown:0 - Already existing calendar: "/remote.php/dav/calendars/poetaster.de/tasks/" "Tasks" "#0082c9"
[D] unknown:0 - Already existing calendar: "/remote.php/dav/calendars/poetaster.de/app-generated--deck--board-1/" "Deck: Personal" "#0087C5"
[D] unknown:0 - Already existing calendar: "/remote.php/dav/calendars/poetaster.de/app-generated--deck--board-3/" "Deck: DWD client" "#dd555c"
[D] unknown:0 - database "/home/defaultuser/.local/share/system/privileged/Calendar/mkcal/db" opened
[D] unknown:0 - loaded timezones from database
[D] unknown:0 - loaded notebook "b1376da7-5555-1111-2222-227549c4e570" "Birthdays" from database
[D] unknown:0 - loaded notebook "1af70443-516f-4abd-919f-7ea330a34626" "Contact birthdays" from database
[D] unknown:0 - loaded notebook "d53c4493-e448-482a-890f-35e10de031c1" "Contact birthdays" from database
[D] unknown:0 - loaded notebook "dfd41285-bc40-4b70-b469-5a83ed2593fe" "Deck: DWD client" from database
[D] unknown:0 - loaded notebook "0f1f1151-efdd-435c-9f0b-f2cd494e438c" "Deck: DWD client" from database
[D] unknown:0 - loaded notebook "b78abc49-1c5d-4441-86e5-c87861518a8f" "Deck: Personal" from database
[D] unknown:0 - loaded notebook "e9b4c900-18fa-456d-8891-099d63f24cb5" "Deck: Personal" from database
[D] unknown:0 - loaded notebook "20e65251-bc72-4c52-8157-2eebd449ceb9" "Default" from database
[D] unknown:0 - loaded notebook "dea24d7a-a34b-41b6-9b94-0bad079586e9" "Personal" from database
[D] unknown:0 - loaded notebook "f2254417-b7bd-4d4f-83fa-e6216b1d1669" "Personal" from database
[D] unknown:0 - loaded notebook "d1a9728b-323c-4347-a68f-30e9a0fd8bb8" "Tasks" from database
[D] unknown:0 - loaded notebook "38ca44b2-a608-4928-8a47-aeaa2794c498" "Tasks" from database
[D] unknown:0 - found notebook: "dea24d7a-a34b-41b6-9b94-0bad079586e9" for remote calendar: "/remote.php/dav/calendars/poetaster.de/personal/"

But, it doesn’t seem to upsync the Personal calendar.

Also, if I delete calendars on the server side, in the Accounts Settings they are correctly removed. In the calendar app, they remain there.

Finally got something to upsync. I made an event assigned to the Task calendar in nextcloud:

[D] unknown:0 - "---------------------------------------------------------------------"
[D] unknown:0 - void NotebookSyncAgent::processETags(const QString&) "5"
[D] unknown:0 - fetch etags finished with result: Buteo::SyncResults::MinorCode(NO_ERROR) ""
[D] unknown:0 - Process tags for server path "/remote.php/dav/calendars/poetaster.de/tasks/"
[D] unknown:0 - incidences  since ""
[D] unknown:0 - adding incidence "3317623A-8933-4950-847E-F521C1B80146" into list QDateTime(2023-06-02 08:55:27.000 UTC Qt::TimeSpec(UTC)) QDateTime(2023-06-02 08:55:27.000 UTC Qt::TimeSpec(UTC))
[W] unknown:0 - Returning empty uri for: "3317623A-8933-4950-847E-F521C1B80146" ""
[D] unknown:0 - have new local addition: "3317623A-8933-4950-847E-F521C1B80146" ""
[D] unknown:0 - incidences deleted since ""
[D] unknown:0 - Calculated local  A/M/R: 1 / 0 / 0
[D] unknown:0 - Calculated remote A/M/R: 0 / 0 / 0
[D] unknown:0 - void NotebookSyncAgent::sendLocalChanges() "5"
[D] unknown:0 - upsyncing local changes: A/M/R: 1 / 0 / 0
[W] unknown:0 - Returning empty uri for: "3317623A-8933-4950-847E-F521C1B80146" ""
[D] unknown:0 - Uploading incidence 0 via PUT for uid: "3317623A-8933-4950-847E-F521C1B80146"
[D] unknown:0 - "Request::Request(QNetworkAccessManager*, Settings*, const QString&, QObject*)" :Entry
[D] unknown:0 - "Request::Request(QNetworkAccessManager*, Settings*, const QString&, QObject*)" :Exit, execution time: 0 ms
[D] unknown:0 - "void Put::sendIcalData(const QString&, const QString&, const QString&)" :Entry
[D] unknown:0 - "---------------------------------------------------------------------"
[D] unknown:0 - "If-None-Match : *"
[D] unknown:0 - "Content-Length : 1201"
[D] unknown:0 - "Content-Type : text/calendar; charset=utf-8"
[D] unknown:0 - "URL = https://user:pass@next.poetaster.de/remote.php/dav/calendars/poetaster.de/tasks/3317623A-8933-4950-847E-F521C1B80146.ics"
[D] unknown:0 - "Request : PUT"
[D] unknown:0 - "BEGIN:VCALENDAR "
[D] unknown:0 - "PRODID:-//K Desktop Environment//NONSGML libkcal 4.3//EN "
[D] unknown:0 - "VERSION:2.0 "
[D] unknown:0 - "X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0 "
[D] unknown:0 - "BEGIN:VTIMEZONE "
[D] unknown:0 - "TZID:Europe/Berlin "
[D] unknown:0 - "BEGIN:STANDARD "
[D] unknown:0 - "TZNAME:CET "
[D] unknown:0 - "TZOFFSETFROM:+0000 "
[D] unknown:0 - "TZOFFSETTO:+0100 "
[D] unknown:0 - "DTSTART:19791231T230000 "
[D] unknown:0 - "RDATE:19791231T230000 "
[D] unknown:0 - "END:STANDARD "
[D] unknown:0 - "BEGIN:DAYLIGHT "
[D] unknown:0 - "TZNAME:CEST "
[D] unknown:0 - "TZOFFSETFROM:+0100 "
[D] unknown:0 - "TZOFFSETTO:+0200 "
[D] unknown:0 - "DTSTART:19810329T020000 "
[D] unknown:0 - "RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3 "
[D] unknown:0 - "END:DAYLIGHT "
[D] unknown:0 - "BEGIN:DAYLIGHT "
[D] unknown:0 - "TZNAME:CEST "
[D] unknown:0 - "TZOFFSETFROM:+0100 "
[D] unknown:0 - "TZOFFSETTO:+0200 "
[D] unknown:0 - "DTSTART:19800406T020000 "
[D] unknown:0 - "RDATE:19800406T020000 "
[D] unknown:0 - "END:DAYLIGHT "
[D] unknown:0 - "BEGIN:STANDARD "
[D] unknown:0 - "TZNAME:CET "
[D] unknown:0 - "TZOFFSETFROM:+0200 "
[D] unknown:0 - "TZOFFSETTO:+0100 "
[D] unknown:0 - "DTSTART:19971026T030000 "
[D] unknown:0 - "RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 "
[D] unknown:0 - "END:STANDARD "
[D] unknown:0 - "BEGIN:STANDARD "
[D] unknown:0 - "TZNAME:CET "
[D] unknown:0 - "TZOFFSETFROM:+0200 "
[D] unknown:0 - "TZOFFSETTO:+0100 "
[D] unknown:0 - "DTSTART:19800928T030000 "
[D] unknown:0 - "RRULE:FREQ=YEARLY;UNTIL=19961027T030000;BYDAY=-1SU;BYMONTH=9 "
[D] unknown:0 - "RDATE:19950924T030000 "
[D] unknown:0 - "END:STANDARD "
[D] unknown:0 - "END:VTIMEZONE "
[D] unknown:0 - "BEGIN:VEVENT "
[D] unknown:0 - "DTSTAMP:20230602T085527Z "
[D] unknown:0 - "CREATED:20230602T085527Z "
[D] unknown:0 - "UID:3317623A-8933-4950-847E-F521C1B80146 "
[D] unknown:0 - "LAST-MODIFIED:20230602T085527Z "
[D] unknown:0 - "SUMMARY:Testy "
[D] unknown:0 - "DTSTART;TZID=Europe/Berlin:20230605T110000 "
[D] unknown:0 - "DTEND;TZID=Europe/Berlin:20230605T120000 "
[D] unknown:0 - "TRANSP:OPAQUE "
[D] unknown:0 - "END:VEVENT "
[D] unknown:0 - "END:VCALENDAR "
[D] unknown:0 - "---------------------------------------------------------------------"
[D] unknown:0 - "void Put::sendIcalData(const QString&, const QString&, const QString&)" :Exit, execution time: 4 ms
[D] unknown:0 - void NotebookSyncAgent::requestFinished(Request*) "5"
[D] unknown:0 - "virtual void Report::handleReply(QNetworkReply*)" :Exit, execution time: 23 ms
[D] unknown:0 - "void Request::requestFinished()" :Exit, execution time: 23 ms
[D] unknown:0 - "void Request::requestFinished()" :Entry
[D] unknown:0 - "REPORT" request finished: QNetworkReply::NetworkError(NoError)
[D] unknown:0 - "virtual void Report::handleReply(QNetworkReply*)" :Entry
[D] unknown:0 - "---------------------------------------------------------------------"
[D] unknown:0 - "REPORT response status code: 207"
[D] unknown:0 - "REPORT response headers:"
[D] unknown:0 - "\tdate : Fri, 02 Jun 2023 08:55:41 GMT"
[D] unknown:0 - "\tstrict-transport-security : max-age=15552000; includeSubDomains; preload"
[D] unknown:0 - "\treferrer-policy : no-referrer"
[D] unknown:0 - "\tx-content-type-options : nosniff"
[D] unknown:0 - "\tx-frame-options : SAMEORIGIN"
[D] unknown:0 - "\tx-permitted-cross-domain-policies : none"
[D] unknown:0 - "\tx-robots-tag : noindex, nofollow"
[D] unknown:0 - "\tx-xss-protection : 1; mode=block"
[D] unknown:0 - "\texpires : Thu, 19 Nov 1981 08:52:00 GMT"
[D] unknown:0 - "\tcache-control : no-store, no-cache, must-revalidate"
[D] unknown:0 - "\tpragma : no-cache"
[D] unknown:0 - "\tcontent-security-policy : default-src 'none';"
[D] unknown:0 - "\tset-cookie : oce94funxr2f=ulejo22e9mr3n78e97gf6unav4; path=/; secure; HttpOnly; SameSite=Lax"
[D] unknown:0 - "oce94funxr2f=ulejo22e9mr3n78e97gf6unav4; path=/; secure; HttpOnly; SameSite=Lax"
[D] unknown:0 - "oce94funxr2f=ulejo22e9mr3n78e97gf6unav4; path=/; secure; HttpOnly; SameSite=Lax"
[D] unknown:0 - "oce94funxr2f=ulejo22e9mr3n78e97gf6unav4; path=/; secure; HttpOnly; SameSite=Lax"
[D] unknown:0 - "oce94funxr2f=30qjjqlh22ulr0veuqca29j5gj; path=/; secure; HttpOnly; SameSite=Lax"
[D] unknown:0 - "\tvary : Brief,Prefer"
[D] unknown:0 - "\tx-request-id : VkeRfbmWJinHlGQpS2SW"
[D] unknown:0 - "\tx-debug-token : VkeRfbmWJinHlGQpS2SW"
[D] unknown:0 - "\tcontent-length : 239"
[D] unknown:0 - "\tcontent-type : application/xml; charset=utf-8"
[D] unknown:0 - "REPORT response data:<?xml version=\"1.0\"?>"
[D] unknown:0 - "<d:multistatus xmlns:d=\"DAV:\" xmlns:s=\"http://sabredav.org/ns\" xmlns:cal=\"urn:ietf:params:xml:ns:caldav\" xmlns:cs=\"http://calendarserver.org/ns/\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"/>"
[D] unknown:0 - "---------------------------------------------------------------------"

That doesn’t work either, but I think because it’s the Task calendar:

Sabre\CalDAV\Exception\InvalidComponentType: iCalendar objects must at least have a component of type VTODO

But there is definetly something screwed in the calendar management.

Something is very fugged. I manually deleted the duplicate entries (sql). Checked that the correct calendars (aka the ones that actually exist on nextcloud) are shown in the settings app. Open calendar and ‘manage calendars’. Initially the correct remaining (local only) calendars are shown. Then all the incorrect (ie. a calendar I removed on the server) calendars are shown again. Strange.

THIS was the state of the db:

sqlite> select * from Calendars;
20e65251-bc72-4c52-8157-2eebd449ceb9|Default||#00e600|151|0|||-1|1685695990|||1668963103||
b1376da7-5555-1111-2222-227549c4e570|Birthdays||#e00080|87|0|Birthday-Nokia||0|1685695908|||1668963105||
dea24d7a-a34b-41b6-9b94-0bad079586e9|Personal||#0082c9|23|1685694483|caldav|5|-1|1685695990||caldav-sync-5|1685610786||
1af70443-516f-4abd-919f-7ea330a34626|Contact birthdays||#E9D859|87|1685696518|caldav|5|-1|1685696520||caldav-sync-5|1685610786||
d1a9728b-323c-4347-a68f-30e9a0fd8bb8|Tasks||#0082c9|663|1685696518|caldav|5|-1|1685696520||caldav-sync-5|1685610786||
b78abc49-1c5d-4441-86e5-c87861518a8f|Deck: Personal||#0087C5|215|1685696518|caldav|5|-1|1685696541||caldav-sync-5|1685610786||
dfd41285-bc40-4b70-b469-5a83ed2593fe|Deck: DWD client||#dd555c|87|1685696518|caldav|5|-1|1685696520||caldav-sync-5|1685610786||
f2254417-b7bd-4d4f-83fa-e6216b1d1669|Personal||#0082c9|23|1685617791|caldav|6|-1|1685618544||caldav-sync-6|1685617061||
d53c4493-e448-482a-890f-35e10de031c1|Contact birthdays||#E9D859|87|1685617791|caldav|6|-1|1685618544||caldav-sync-6|1685617061||
38ca44b2-a608-4928-8a47-aeaa2794c498|Tasks||#0082c9|23|1685617791|caldav|6|-1|1685618544||caldav-sync-6|1685617061||
e9b4c900-18fa-456d-8891-099d63f24cb5|Deck: Personal||#0087C5|87|1685617791|caldav|6|-1|1685618544||caldav-sync-6|1685617061||
0f1f1151-efdd-435c-9f0b-f2cd494e438c|Deck: DWD client||#dd555c|87|1685617791|caldav|6|-1|1685618544||caldav-sync-6|1685617061||

I removed ALL the remote entries. The calendar added the following back:

sqlite> select * from Calendars;
20e65251-bc72-4c52-8157-2eebd449ceb9|Default||#00e600|151|0|||-1|1685695990|||1668963103||
b1376da7-5555-1111-2222-227549c4e570|Birthdays||#e00080|215|0|Birthday-Nokia||0|1685697552|||1668963105||
dea24d7a-a34b-41b6-9b94-0bad079586e9|Personal||#0082c9|151|1685694483|caldav|5|-1|1685697552||caldav-sync-5|1685610786||
b0756d6d-32e1-4ff2-aad0-054fe13ecebf|Contact birthdays||#E9D859|215|1685697561|caldav|5|-1|1685697563||caldav-sync-5|1685697280||
4190ad1f-8bf3-4aed-b61e-696290952d61|Tasks||#0082c9|151|1685697561|caldav|5|-1|1685697563||caldav-sync-5|1685697280||
9ca0a154-ca61-4b16-9983-421cc9031dc5|Deck: Personal||#0087C5|215|1685697561|caldav|5|-1|1685697563||caldav-sync-5|1685697280||
037f898a-5271-4f5a-a7c9-99c001db984d|Deck: DWD client||#dd555c|215|1685697561|caldav|5|-1|1685697563||caldav-sync-5|1685697281||

Uhg. But, I added the Personal ‘back’ to nextcloud and to THAT I can sync from the phone. But out of the default/Personal calendar I cannot sync.

EDIT: Just to satisfy my curiosity I did splits of the ical/vcard output and dumped those into vdirsync directories on device. Those sync just fine. As do REMOTE calendars from within the calendar. Contacts didn’t sync from the device either.

You can look at the account column in the calendar database for your duplicated entries : they belongs to two different accounts (one in 5 while the other one is 6, you can see it also with the syncProfile column).

I’m sorry, I don’t fully get what happened. What do you call “default/Personal”, is it the calendar with id 20e65251-bc72-4c52-8157-2eebd449ceb9 or with id dea24d7a-a34b-41b6-9b94-0bad079586e9 ?

If I get it well, you mean that a calendar that is created by default in Netxcloud, you can get events from, but sync are not sending events to it ? While if you create a new calendar on server, you have two way sync ? Which calendar is it in the above list that you cannot send event to ? You may notice that several calendars have flags = 215, which means being read-only (normally you can’t add event to them anyway from the UI, so I guess we’re not speaking of any of these).

I just realized that I had created those endpoints with caldav/cardav so that has nothing to do with the nextcloud account. well, except that they are the same.

I mean the Personal calendar that is created by default along with the Birthdays Calendar. I have a feeling that something goes awry when you have a unique id local ‘Personal’ and there is also one (also on nextcloud by ‘default’) called ‘Personal’ but obviously with it’s own UUID? I had tried deleting the one on nextcloud, but that did not seem to make a difference.

All of the calendars on nextcloud, if I create an event on device with that calendar, sync works. Just local ‘Personal’ is never synced up.

I just removed the car/caldav account to make sure that was not playing a role and looked in the db:

Default|151
Birthdays|215
Personal|151
Contact birthdays|215
Tasks|151
Deck: Personal|215
Deck: DWD client|215
Personal|663

Are the values I see. The first three are jolla and the rest are on next cloud. All of those can be written to using vdirsync from the device.

Ah things are getting clearer. If I understand well, Nextcloud calendars are properly synced both directions.

The remaining point I still feel unclear with, is this “Personal” calendar status. As far as I know, Jolla is creating only two calendars on device, the “Default” one and the “Birthdays” one. These ones are local to the device and obviously not synced with anything.

In the last list you provided, there are two calendars labelled “Personal”, one with the default flag (663 means “accept events, tasks and journals, is master, visible and default”) and one without (151 means “accept events, tasks and journals, is master and visible”), see sailfishos/mkcal/src/sqliteformat.h#CalendarFlag for the flag values. From your previous messages, I guess the first “Personal” is the default Nextcloud calendar, while the second one is the one you added on server and synced. You can check that they belongs to the same account from the SQLite database, with the column account.

If I’m still understanding properly, you can sync both direction with the second “Personal” calendar, while you can only downsync with the first.

So, add an event on device in the “first” Personal calendar (don’t confuse with the second one : /), and get a debug trace from msyncd. Can you then look at the upsync part in the log, particularly if there is a PUT request for this new event on device and what is the server answer to this request ?

Ok, so those are never synced anyway? If that’s the case then my dump (I have a full year of stuff on the local calendar) and vdirsync to remote was inevitable anyway.

The current state in the db:

Default|23|
Birthdays|87|
Personal|151|5
Contact birthdays|215|5
Tasks|151|5
Deck: Personal|215|5
Deck: DWD client|215|5
Personal|23|5
local|663|5

‘local’ I created with:

  • devel-su -p icalconverter export calendar.ics
  • …/Documents/ical_split.py …/Documents/calendar.ics local/ (where local is a vdirsync local calendar)
  • vdirsyncer sync

The ‘local’ calendar (which is actually remote) is subscribed on the phone, but syncing it seems foobar. probably just too many items.