pimutils / vdirsyncer

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

Accept NotFoundErrors #760

Open jalmeroth opened 6 years ago

jalmeroth commented 6 years ago

Hi there,

I am trying to utilize vdirsyncer to one-way sync some calendars from Apple Calendar Server into a singlefile ics. Unfortunately, it seems there are some broken URLs/Files reported by the server. I would like to accept these errors and just skip over them, but unfortunately vdirsyncer raises an exception and quits:

error: Unknown error occured for username/calendar: /calendars/__uids__/181DB98E-F898-4643-B5A9-E7DBA477B001/calendar/https:%2Fwww.xing.com%2Fevents%2Fgrowthmarketingsummit-2018-1939105.ics
error: Use `-vdebug` to see the full traceback.
debug:   File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/cli/tasks.py", line 69, in sync_collection
debug:     partial_sync=pair.partial_sync
debug:   File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 136, in sync
debug:     b_nonempty = b_info.prepare_new_status()
debug:   File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 59, in prepare_new_status
debug:     if prefetch else ()):
debug:   File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/storage/dav.py", line 507, in get_multi
debug:     raise exceptions.NotFoundError(href)

Is there any way (hidden switch) to change this behaviour?

Thank you & best regards, Jan

untitaker commented 6 years ago

I really want to avoid supporting this. You should attempt to fix your server by renaming those files to safe filenames or deleting them

On July 27, 2018 9:31:44 AM GMT+02:00, Jan Almeroth notifications@github.com wrote:

  • Your vdirsyncer version: vdirsyncer, version 0.16.7
  • If applicable, which server software (and which version) you're using: Apple Calendar Server
  • Your Python version: Python 3.6.5
  • Your operating system: MacOS 10.13.6

Hi there,

I am trying to utilize vdirsyncer to one-way sync some calendars from Apple Calendar Server into a singlefile ics. Unfortunately, it seems there are some broken URLs/Files reported by the server. I would like to accept these errors and just skip over them, but unfortunately vdirsyncer raises an exception and quits:

error: Unknown error occured for username/calendar: /calendars/uids/181DB98E-F898-4643-B5A9-E7DBA477B001/calendar/https:%2Fwww.xing.com%2Fevents%2Fgrowthmarketingsummit-2018-1939105.ics error: Use -vdebug to see the full traceback. debug: File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/cli/tasks.py", line 69, in sync_collection debug: partial_sync=pair.partial_sync debug: File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/init.py", line 136, in sync debug: b_nonempty = b_info.prepare_new_status() debug: File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/init.py", line 59, in prepare_new_status debug: if prefetch else ()): debug: File "/Users/jan/.venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/storage/dav.py", line 507, in get_multi debug: raise exceptions.NotFoundError(href)

Is there any way (hidden switch) to change this behaviour?

Thank you & best regards, Jan

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/pimutils/vdirsyncer/issues/760

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jalmeroth commented 6 years ago

Thanks for your reply, @untitaker! Unfortunately, I have no control over the server so renaming/deleting is not possible.

puzzlewolf commented 6 years ago

Hi everyone,

I am seeing the same issue. In this case the calendar is r/w, but as this is about reading I think it's the same.

error: Unknown error occured for tu/Privat: /CalDAV/Privat/20161108095700@hafas.ics
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/cli/tasks.py", line 69, in sync_collection
debug:     partial_sync=pair.partial_sync
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/sync/__init__.py", line 135, in sync
debug:     a_nonempty = a_info.prepare_new_status()
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/sync/__init__.py", line 59, in prepare_new_status
debug:     if prefetch else ()):
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/storage/dav.py", line 505, in get_multi
debug:     raise exceptions.NotFoundError(href)

While trying to investigate what this error means, I found the following:

Further up in the log, there is debug: Normalized URL from '/CalDAV/Privat/20161108095700%2540hafas.ics' to '/CalDAV/Privat/20161108095700@hafas.ics' debug: Already normalized: '/CalDAV/Privat/20161108095700@hafas.ics' Could this be somehow connected?

Also, the id shows up in the log-line after debug: REPORT https://groupware.tu-braunschweig.de/CalDAV/Privat/ but not after debug: Sending request...

Does this mean the item is being requested, but the server is not providing the details? Maybe because of some problem with urlencoding/normalization of special characters?

@untitaker Do you have an idea what about these filenames could be the problem?

david-jointech commented 6 years ago

I think the '@' is the problem, as I get this error only with objects where the name contains an '@'.