carddav sync: can't PUT contacts to server
Hi,
I have a Jolla C running the latest stable release of Sailfish (2.1.3.7).
I'm trying to configure two-way sync with a Fastmail account, but can't seem to send my contact changes to the server.
I am able to correctly down-sync (i.e. get contacts from the server), which I have been able to confirm with both msyncd's log and by checking that a new contact created on the server appears on my phone.
Unfortunately, I cannot correctly up-sync : when I create a new contact, it does not appear on the server and I get a 403 error in msyncd's logs when the PUT request is sent.
I'm not sure what I can do at this point. Do you guys know how I could solve this ?
Log extract, for context :
[D] unknown:0 - void Syncer::continueSync(const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&) storing remote changes to local device: AMR: 612 0 0 for account: 89
[W] unknown:0 - "Unable to decrement semaphore /tmp/qtcontacts-sqlite-semaphore: Resource temporarily unavailable (11)"
[W] unknown:0 - "Failed to lock key memory region for qtcontacts-sqlite"
[D] unknown:0 - virtual void Syncer::upsyncLocalChanges(const QDateTime&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&, const QString&) upsyncing local changes to remote server: AMR: 1 0 0 for account: 89 since: QDateTime( Qt::TimeSpec(LocalTime))
[D] unknown:0 - void CardDav::upsyncUpdates(const QString&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&) upsyncing updates to addressbook: "/dav/addressbooks/user/myusername@mydomain.com/Default/" : 1 0 0
[D] unknown:0 - generated vcard:
[D] unknown:0 - "BEGIN:VCARD"
[D] unknown:0 - "VERSION:3.0"
[D] unknown:0 - "N:Ploup2;Ploup2;;;"
[D] unknown:0 - "REV:2018-01-02T16:52:03Z"
[D] unknown:0 - "EMAIL:ploup@ploup.ploup"
[D] unknown:0 - "UID:215e15eb765744b689173216d9b02b2b"
[D] unknown:0 - "FN:Ploup2 Ploup2"
[D] unknown:0 - "END:VCARD"
[D] unknown:0 - generateUpsyncRequest(): "" QUrl("https://myusername+Default%40mydomain.com@carddav.fastmail.com/dav/addressbooks/user/myusername@mydomain.com/Default//215e15eb765744b689173216d9b02b2b.vcf") "PUT" : 164 bytes
[D] unknown:0 - "Content-Type" = "text/vcard; charset=utf-8"
[D] unknown:0 - "Content-Length" = "164"
[D] unknown:0 - void CardDav::upsyncUpdates(const QString&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&, const QList<QtContacts::QContact>&) ignored 0 spurious updates to addressbook: "/dav/addressbooks/user/myusername@mydomain.com/Default/"
[D] unknown:0 - identityimpl.cpp 576 remoteObjectDestroyed
[D] unknown:0 - identityimpl.cpp 96 updateState Updating state: "NeedsRegistration" SignOn::IdentityImpl(0xc40d78)
[W] unknown:0 - void CardDav::upsyncResponse() error: QNetworkReply::NetworkError(ContentOperationNotPermittedError) ( 403 )
[W] unknown:0 - CardDAV sync finished with error: 403 purging state data for account: 89
[C] unknown:0 - CardDAV sync failed: 401 ""
[D] unknown:0 - lastSync: QDateTime(2018-01-02 16:41:22.000 UTC Qt::TimeSpec(UTC))
[D] unknown:0 - lastSync: QDateTime(2018-01-02 16:41:22.000 UTC Qt::TimeSpec(UTC))
[D] unknown:0 - Session finished: "carddav.Contacts-89" , status: 3
[D] unknown:0 - aStatus 3
[D] unknown:0 - ProfileManager::syncProfile( "carddav.Contacts-89" )
[D] unknown:0 - found a valid sync profile with the given name: "carddav.Contacts-89"
[D] unknown:0 - Stopping the OOP process for "carddav"
[D] unknown:0 - Process "/usr/lib/buteo-plugins-qt5//oopp/carddav-client" finished with exit code 15
[D] unknown:0 - ProfileManager::syncProfile( "carddav.Contacts-89" )
[D] unknown:0 - found a valid sync profile with the given name: "carddav.Contacts-89"
[D] unknown:0 - Sync status changed for account "89"
[D] unknown:0 - ProfileManager::syncProfile( "caldav-sync-88" )
[D] unknown:0 - found a valid sync profile with the given name: "caldav-sync-88"
[D] unknown:0 - ProfileManager::syncProfile( "caldav-sync-89" )
[D] unknown:0 - found a valid sync profile with the given name: "caldav-sync-89"
[D] unknown:0 - No sync log found for profile: "caldav-sync-89"
Ok, so I reproduced the PUT request using RESTClient in the browser and I can reproduce the bug if I put a double-slash in the URL the same way msynd does. If I remove the double slash, the bug is gone. @chris.adams I suppose it's a bug in the carddav lib ?
jbruggem ( 2018-01-02 23:35:33 +0200 )editFor reference, there's an issue tracked on fastmail's carddav server : https://github.com/cyrusimap/cyrus-imapd/issues/2228 (no guarantee it will be solved, though. They might consider it's not their problem).
jbruggem ( 2018-01-05 11:19:26 +0200 )editAlso for reference: https://together.jolla.com/question/158893/caldavcarddav-testing-volunteers-requested/?answer=177130#post-id-177130
jbruggem ( 2018-01-05 11:20:03 +0200 )editI will investigate this. Thanks for the report.
chris.adams ( 2018-01-18 04:10:48 +0200 )edit