"409 Conflict" response not handled on PUT request



  • Zimbra 8.6.0_GA_1169 with Davdroid 0.8 on android 5.1.1 phone and also 4.4.2 tablet

    Sometimes when I create a task or calendar event on my zimbra server and davdroid comes around to it's scheduled sync, my devices give me a 409 conflict error, not always for the same event.

    I'm trying to focus my troubleshooting and hope to provide some appropriate logs, but before I do, are there any characters that I should not use in the description section of my tasks or calendar events? I had an issue when I used <> in a task once and I "think" it started throwing 409 errors, because when I deleted those characters, the errors went away.

    Thanks & sorry this question is a bit vague.



  • update, this 409 error happens with any characters in the task, including alphanumeric only.

    I turned off tasks sync and it stopped for a short while, but now even in calendar and contact sync only it's happening again. If I re-provision the account, I can get the error to stop, until another event starts provoking it again.

    I'll get some logs organised soon



  • after turning task sync on for an existing DAVdroid account on the device, these are the two concurrent logs

    output from adb log

    *07-03 10:46:14.246    30410-844/at.bitfire.davdroid:sync I/davdroid.DavSyncAdapter﹕ Performing sync for authority org.dmfs.tasks
    07-03 10:46:14.247    30410-844/at.bitfire.davdroid:sync D/davdroid.DavSyncAdapter﹕ Creating new DavHttpClient
    07-03 10:46:14.248    30410-844/at.bitfire.davdroid:sync D/davdroid.DavSyncAdapter﹕ Server supports VCard version 3.0
    07-03 10:46:14.252    30410-844/at.bitfire.davdroid:sync V/davdroid.URIUtils﹕ Normalized URL https://serveraddress.com.au/dav/user@host.com.au/Tasks/ -> https://serveraddress.com.au/dav/user@host.com.au/Tasks/
    07-03 10:46:14.252    30410-844/at.bitfire.davdroid:sync D/davdroid.WebDavResource﹕ Using preemptive authentication (not compatible with Digest auth)
    07-03 10:46:14.255    30410-844/at.bitfire.davdroid:sync I/davdroid.SyncManager﹕ Remotely removing 0 deleted resource(s) (if not changed)
    07-03 10:46:14.257    30410-844/at.bitfire.davdroid:sync I/davdroid.SyncManager﹕ Uploading 0 new resource(s) (if not existing)
    07-03 10:46:14.265    30410-844/at.bitfire.davdroid:sync I/davdroid.SyncManager﹕ Uploading 1 modified resource(s) (if not changed)
    07-03 10:46:14.270    30410-844/at.bitfire.davdroid:sync V/davdroid.URIUtils﹕ Normalized URL 2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics -> 2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics
    07-03 10:46:14.364    30410-844/at.bitfire.davdroid:sync E/davdroid.DavSyncAdapter﹕ Hard HTTP error 409
        at.bitfire.davdroid.webdav.HttpException: 409 Conflict
                at at.bitfire.davdroid.webdav.WebDavResource.checkResponse(WebDavResource.java:431)
                at at.bitfire.davdroid.webdav.WebDavResource.checkResponse(WebDavResource.java:405)
                at at.bitfire.davdroid.webdav.WebDavResource.put(WebDavResource.java:382)
                at at.bitfire.davdroid.resource.RemoteCollection.update(RemoteCollection.java:201)
                at at.bitfire.davdroid.syncadapter.SyncManager.pushDirty(SyncManager.java:169)
                at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:50)
                at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:146)
                at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    07-03 10:46:14.372    30410-844/at.bitfire.davdroid:sync I/davdroid.DavSyncAdapter﹕ Sync complete for org.dmfs.tasks
    07-03 10:46:14.390  30410-30410/at.bitfire.davdroid:sync D/davdroid.DavSyncAdapter﹕ Closing httpClient*
    

    output from tail -f mailbox.log | grep dav on zimbra server

    *2015-07-03 10:46:13,893 INFO  [qtp509886383-3064:https://10.0.12.9:8443/dav/user@host.com.au/Tasks/2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics] [aname=user@host.com.au;ip=10.0.12.9;ua=DAVdroid/0.8.0;] FileUploadServlet - saveUpload(): received Upload: { accountId=4164785c-776c-42af-9843-fccba389d44f, time=Fri Jul 03 10:46:13 EST 2015, size=399, uploadId=dbc3185c-e8ac-4e27-8740-29ef8144a571:a30a5022-78c6-4432-b92c-86f134f4e874, name=null, path=null }
    2015-07-03 10:46:13,895 INFO  [qtp509886383-3064:https://10.0.12.9:8443/dav/user@host.com.au/Tasks/2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics] [aname=user@host.com.au;ip=10.0.12.9;ua=DAVdroid/0.8.0;] dav - sending http error 409 because: CalDAV client has stale event: event has different etag ("44424-44424") vs "44422-44422"
    2015-07-03 10:46:13,895 INFO  [qtp509886383-3064:https://10.0.12.9:8443/dav/user@host.com.au/Tasks/2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics] [aname=user@host.com.au;ip=10.0.12.9;ua=DAVdroid/0.8.0;] dav - DavServlet operation PUT to /home/user@host.com.au/Tasks/2689ca2d-5b13-4cf4-88e9-aeed34faeb62.ics (depth: zero) finished in 3ms*
    

  • developer

    This is interesting. Currently, DAVdroid only expects "HTTP 412 Precondition not met" in this case. Does anybody know when the server returns 409 and when 412? According to the RFCs, 409 can be returned if there's a chance that the user may resolve the conflict, but that's not interesting in the case of DAVdroid because it's not interactive.

    So I guess 409 should just be ignored as well as 412, meaning that the server version of the resource (contact/task/event) will be downloaded.



  • Will DAVdroid will continue the sync and download the server version over the top of the conflicting phone based appointment?

    I have noted that when I create a task on the server, and when it produces a 409, that task will never sync to the phone unless I completely reprovision the davdroid client.

    I have never seen a 409 when I create a task on the phone, it will just sync normally according to the sync schedule(or manual invokation).

    In 409 conflict situations, what are the normal responses that are taken by the client and server?
    Should I put this issue to Zimbra for their input?


  • developer

    Will DAVdroid will continue the sync and download the server version over the top of the conflicting phone based appointment?

    Yes, I think it would be enough to ignore the 409 status (like the 412 one) to do so.

    I have noted that when I create a task on the server, and when it produces a 409, that task will never sync to the phone unless I completely reprovision the davdroid client.

    That's true – currently, DAVdroid doesn't know what 409 means so it stops with an error.

    In 409 conflict situations, what are the normal responses that are taken by the client and server?
    Should I put this issue to Zimbra for their input?

    I have only seen 412 so far, but 409 seems to be a valid answer.


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.