pimutils / vdirsyncer

📇 Synchronize calendars and contacts.
https://vdirsyncer.pimutils.org/
Other
1.55k stars 160 forks source link

Sync aborted after a single error #1101

Open chibenwa opened 9 months ago

chibenwa commented 9 months ago

When running a sync, vdirsyncer migrates a contact with two FN properties, which actually is not supported in sabre older versions. The attempt fails, which is fine to me (after all that's a sabre issue).

Here is the original error:

error: Unknown error occurred for bob_contacts/contacts: 415, message='Unsupported Media Type', url=URL('https://dav.poc-mail-avocat.fr/addressbooks/6528c0dbbc1b180078e2aec4/contacts/sabre-vobject-8c1de447-93f7-457b-a37f-e5c237a11914.vcf')
error: Use `-vdebug` to see the full traceback.
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/cli/utils.py", line 70, in handle_cli_error
debug:     raise e
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 160, in sync
debug:     await action.run(a_info, b_info, conflict_resolution, partial_sync)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 183, in run
debug:     await self._run_impl(a, b)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 212, in _run_impl
debug:     href, etag = await self.dest.storage.upload(self.item)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 601, in upload
debug:     rv = await self._put(href, item, None)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 569, in _put
debug:     response = await self.session.request(
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 416, in request
debug:     return await http.request(method, url, session=session, **more)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/http.py", line 157, in request
debug:     response.raise_for_status()
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1011, in raise_for_status
debug:     raise ClientResponseError(

However the follow up operation fails, the next one with:

error: Unknown error occurred for bob_contacts/contacts: 415, message='Unsupported Media Type', url=URL('https://dav.poc-mail-avocat.fr/addressbooks/6528c0dbbc1b180078e2aec4/contacts/sabre-vobject-8c1de447-93f7-457b-a37f-e5c237a11914.vcf')
error: Use `-vdebug` to see the full traceback.
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/cli/utils.py", line 70, in handle_cli_error
debug:     raise e
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 160, in sync
debug:     await action.run(a_info, b_info, conflict_resolution, partial_sync)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 183, in run
debug:     await self._run_impl(a, b)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 212, in _run_impl
debug:     href, etag = await self.dest.storage.upload(self.item)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 601, in upload
debug:     rv = await self._put(href, item, None)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 569, in _put
debug:     response = await self.session.request(
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 416, in request
debug:     return await http.request(method, url, session=session, **more)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/http.py", line 157, in request
debug:     response.raise_for_status()
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1011, in raise_for_status

And then all with:

debug: Sending request...
error: Unknown error occurred for bob_contacts/z-server-generated--system: Session is closed
error: Use `-vdebug` to see the full traceback.
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/cli/utils.py", line 70, in handle_cli_error
debug:     raise e
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 160, in sync
debug:     await action.run(a_info, b_info, conflict_resolution, partial_sync)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 183, in run
debug:     await self._run_impl(a, b)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 212, in _run_impl
debug:     href, etag = await self.dest.storage.upload(self.item)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 22, in inner
debug:     return await f(self, *args, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 601, in upload
debug:     rv = await self._put(href, item, None)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 569, in _put
debug:     response = await self.session.request(
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 416, in request
debug:     return await http.request(method, url, session=session, **more)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/http.py", line 136, in request
debug:     response = await session.request(method, url, **kwargs)
debug:   File "/home/hp/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/aiohttp/client.py", line 426, in _request
debug:     raise RuntimeError("Session is closed")
Copying (uploading) item poc-audriga to my_destination/z-server-generated--system

My expectation would be that vdirsyncer continue to migrate and sync vcard when faced with a failure before reporting it to me (error code 1).


Things to include in your bugreport:

$ cat config.example 
[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.vdirsyncer/status/999012/carddav"

# CARDDAV
[pair bob_contacts]
a = "my_source"
b = "my_destination"
collections = ["from a"]

# Calendars also have a color property
metadata = ["displayname", "color"]

[storage my_source]
type = "carddav"
url = "https://xxxxx/remote.php/dav/addressbooks/users/yyy"
username = "yyy"
password = "abc"

[storage my_destination]
type = "carddav"
url = "https://fgnetmetym/addressbooks/6528c0dbbc1b180078e2aec4"
username = "zzzz"
password = "def"

vdirsync.log.txt

WhyNotHugo commented 9 months ago

The vdirsyncer rewrite is capable of continuing sync even if one item fails. I'm not sure that it is feasible to fix this on the current version.

chibenwa commented 9 months ago

The vdirsyncer rewrite is capable of continuing sync even if one item fails.

Can you share this URL?