Since a few weeks my phone (XA2+, SFOS 4.5.0.19) duplicates contacts, newly created on the phone, on my Nextcloud account. On the phone those contacts are fine, however there are now hundreds of entries of each of those contacts.
After activated extensive logging I see plenty of 412-Errors:
unknown:0 - CardDAV sync for account: 22 finished with error: 412
[W] unknown:0 - QMetaObject::invokeMethod: No such method Syncer::syncFinishedWithError()
[W] unknown:0 - void CardDav::upsyncResponse() error: QNetworkReply::NetworkError(UnknownContentError) ( 412 )
[D] unknown:0 - "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
[D] unknown:0 - "<d:error xmlns:d=\"DAV:\" xmlns:s=\"http://sabredav.org/ns\">"
[D] unknown:0 - " <s:exception>Sabre\\DAV\\Exception\\PreconditionFailed</s:exception>"
[D] unknown:0 - " <s:message>An If-Match header was specified and the resource did not exist</s:message>"
[D] unknown:0 - " <s:header>If-Match</s:header>"
[D] unknown:0 - "</d:error>"
Just read the “Sync Logs” paragraph. There is no need to do the point 2. (no need for persistent journal logging), just stop the sync daemon and restart it manually in debug mode (point 3. and 4.), then perform a contact sync from the account setting page for instance.
Go back to normal by stopping the manually-started sync daemon. And start it again via systemctl.
Sorry, not specifically. Usely I deal with calendar sync log. They can become very long also, particularly with the dump of every transiting CalDAV entries. I guess it’s the same with CardDAV.
Keep the original with you and try to send a copy with all the CardDAV content removed. I guess the content is not an issue in your case. But try to keep all the other information, particularly the etag values if any. They may be responsible for the duplications.
But this doesn’t have to be related to the contact duplicating bug. It is possible that those are all the duplicated contacts I already deleted… the number could add up to it.
At the end it says
[W] unknown:0 - void CardDav::upsyncResponse() error: QNetworkReply::NetworkError(UnknownContentError) ( 412 )
[D] unknown:0 - “<?xml version=\"1.0\" encoding=\"utf-8\"?>”
[D] unknown:0 - “<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns\“>”
[D] unknown:0 - " <s:exception>Sabre\DAV\Exception\PreconditionFailed</s:exception>”
[D] unknown:0 - " <s:message>An If-Match header was specified and the resource did not exist</s:message>"
[D] unknown:0 - " <s:header>If-Match</s:header>"
[D] unknown:0 - “</d:error>”
[W] unknown:0 - CardDAV sync for account: 33 finished with error: 412
One interesting thing is, that might be the error or could be totally not relevant:
Every UID ends usually with BUT not the entries that are causing the problems. Is it possible that the addressbook doesn’t set the UID properly somehow and that irritates somewhere some part?
So. I’m not going to post the full log due to it being almost impossible to properly render it anonymous. But if you like to, we can have a debug session with desktop sharing and stuff and I can let you have a look at it directly.
I believe I have reported that issue two years back. At that time it helped to redo the NextCloud account on the phone. But after the next SFOS updated the bug was back.