vdirsyncer icon indicating copy to clipboard operation
vdirsyncer copied to clipboard

Unknown error, Precondition Failed

Open strk opened this issue 8 years ago • 10 comments

vdirsyncer, version 0.16.3 Python 3.5.3 Ubuntu 17.04 -vdebug output:

debug: Sending request...
debug: 412
debug: {'Cache-Control': 'private, max-age=0', 'Date': 'Mon, 01 Jan 2018 10:06:08 +0000', 'Connection': 'keep-alive', 'Expires': 'Mon, 01 Jan 2018 10:06:08 +0000', 'DAV': '1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook', 'Server': 'DavMail Gateway 4.8.0.3-2488', 'Content-Length': '0'}

error: Unknown error occured for calendar_linz_ssan_to_local: Precondition Failed
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/cli/utils.py", line 74, in handle_cli_error
debug:     raise e
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/sync/__init__.py", line 153, in sync
debug:     partial_sync
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/sync/__init__.py", line 177, in run
debug:     self._run_impl(a, b)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/sync/__init__.py", line 204, in _run_impl
debug:     href, etag = self.dest.storage.upload(self.item)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/storage/base.py", line 15, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/storage/base.py", line 15, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/storage/dav.py", line 562, in upload
debug:     return self._put(href, item, None)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/storage/dav.py", line 531, in _put
debug:     headers=headers
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/storage/dav.py", line 390, in request
debug:     return http.request(method, url, session=self._session, **more)
debug:   File "/usr/local/lib/python3.5/dist-packages/vdirsyncer/http.py", line 179, in request
debug:     raise exceptions.PreconditionFailed(r.reason)
error: 1 out of 2 tasks failed.

strk avatar Jan 01 '18 10:01 strk

That response is sent from the server... is this something that happens all the time or just sometimes? It generally indicates that multiple (2+) clients are syncing at the same time.

untitaker avatar Jan 01 '18 15:01 untitaker

Ah, interesting! Indeed it does not happen all the time, I'll try to tweak frequencies of sync from multiple clients

strk avatar Jan 02 '18 08:01 strk

@strk any updates on this?

untitaker avatar Jan 15 '18 19:01 untitaker

I still get that error, even trying multiple times with 1 minute gap

strk avatar Jan 15 '18 19:01 strk

I get the same thing with 0.18 (ubuntu package):

debug: Sending request...
debug: 412
debug: {'Server': 'nginx', 'Date': 'Wed, 17 May 2023 11:44:56 GMT', 'Content-Type': 'application/xml; charset=utf-8', 'Content-Length': '91', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN'}
debug: <?xml version="1.0" encoding="utf-8"?>
debug: <D:error xmlns:D="DAV">Precondition Failed</D:error>
error: Unknown error occurred for eija_cal/join: Precondition Failed
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/cli/utils.py", line 75, in handle_cli_error
debug:     raise e
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/sync/__init__.py", line 154, in sync
debug:     action.run(a_info, b_info, conflict_resolution, partial_sync)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/sync/__init__.py", line 177, in run
debug:     self._run_impl(a, b)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/sync/__init__.py", line 207, in _run_impl
debug:     href, etag = self.dest.storage.upload(self.item)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/storage/base.py", line 13, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/storage/base.py", line 13, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 548, in upload
debug:     return self._put(href, item, None)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 516, in _put
debug:     response = self.session.request(
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 397, in request
debug:     return http.request(method, url, session=self._session, **more)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/http.py", line 170, in request
debug:     raise exceptions.PreconditionFailed(r.reason)

This happens on every run, for the same calendar item. Nothing else is accessing that calendar yet, since I am migrating to a new server.

larseggert avatar May 17 '23 11:05 larseggert