You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vdirsyncer fails to sync due to double URL encoding #491
Your vdirsyncer version
vdirsyncer, version 0.11.3
If applicable, which server software (and which version) you're using
DavMail 4.7.2-2427
Your Python version
python --version: Python 2.7.12
python3 --version: 4.7.2-2427
Your operating system
OpenSuse 13.2
Your config file
[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = ~/.local/share/vdirsyncer/status/
# CALDAV
[pair my_calendar]
a = my_calendar_local
b = my_calendar_remote
collections = ["from a", "from b"]
# Calendars also have a color property
metadata = ["displayname", "color"]
[storage my_calendar_local]
type = filesystem
path = ~/.local/share/khal/calendars/private
fileext = .ics
[storage my_calendar_remote]
type = caldav
url = http://localhost:10801/users/s.boehringer@lumc.nl/calendar
username = ****
password = *****
Use vdirsyncer -vdebug for debug output.
...
error: Unknown error occured for my_calendar/calendar: /users/S.Boehringer@lumc.nl/calendar/AAMkADFhMDg1YzYwLTgwMDItNDJiYi1hNmY2LTgxZDI1MDcwNmIzMgBGAAAAAAAutjjQvZGzQZDR7unScTwfBwA4R1qAXwlGQ7K94p6FsS4bAAAA66iHAAD2R2asQXn-SImONQz5BBbsAABHFlNrAAA%3D.EML
error: Use `-vdebug` to see the full traceback.
debug: File "/usr/lib/python3.4/site-packages/vdirsyncer/cli/tasks.py", line 66, in sync_collection
debug: force_delete=force_delete
debug: File "/usr/lib/python3.4/site-packages/vdirsyncer/sync.py", line 216, in sync
debug: b_info.prepare_idents()
debug: File "/usr/lib/python3.4/site-packages/vdirsyncer/sync.py", line 124, in prepare_idents
debug: if prefetch else ()):
debug: File "/usr/lib/python3.4/site-packages/vdirsyncer/storage/dav.py", line 452, in get_multi
debug: raise exceptions.NotFoundError(href)
error: 1 out of 2 tasks failed.
The failing URL is partly encoded (trailing %3D). Replacing this with '=' in cadaver prints a proper caldav event.
Unfortunately, the error persists in version 0.12.1 in identical form.
DavMail is the CalDav server which is a Microsoft Exchange adaptor. As cadaver has a similar problem with showing the events with html-quoted characters, I am wondering whether is is really a DavMail bug. However, I would have a good idea as to how to proceed at the moment.
The already normalized line occurs two times in the debug output. The "@" character is unquoted, the "=" is quoted.
Interestingly, the debug logs of DavMail do not show an access attempt to the event above. No errors are shown at all. This is different from cadaver that triggers errors in the DavMail server. Finally, Thunderbird works fine. Taken together, I would rather tend to assume an independent bug in vdirsync.
Here is the davmail log from DavMail as given for a Thunderbird transaction (it is not the same event as I could not identify it). The EML-resources seem to be recurrent events. Thunderbird has quoted the "@" also.
Date: Thu Aug 25 17:04:21 CEST 2016 (1472137461367)
Thread: CaldavConnection-55185
Message #: 2
Level: DEBUG
NDC:
Category: davmail
Message: < PUT /users/s.boehringer%40lumc.nl/calendar/AAMkADFhMDg1YzYwLTgwMDItNDJiYi1hNmY2LTgxZDI1MDcwNmIzMgBGAAAAAAAutjjQvZGzQZDR7unScTwfBwA4R1qAXwlGQ7K94p6FsS4bAAAA66iHAAD2R2asQXn-SImONQz5BBbsAAAkN0HIAAA%3D.EML HTTP/1.1
Location: davmail.ui.tray.DavGatewayTray.displayMessage(DavGatewayTray.java:96)
Thrown:
above the return x. The tail of the output ahead of the error message is given below. The to_native function does not appear to be unquoting the %3D (if i understand the meaning correctly). The error message stays exactly the same.
I believe that the problem is not due to mis-quoting. I got confused by the partial quoting of the URL but this seems to be handled well somehow, as the DavMail requests never results in an error. Also vdirsyncer fetches a lot of events and only bails out later in the processing.
According to DavMail the request looks as follows:
Date: Fri Aug 26 12:30:29 CEST 2016 (1472207429202)
Thread: CaldavConnection-59741
Message #: 1796
Level: DEBUG
NDC:
Category: davmail.exchange.ExchangeSession
Message: Get event: AAMkADFhMDg1YzYwLTgwMDItNDJiYi1hNmY2LTgxZDI1MDcwNmIzMgBGAAAAAAAutjjQvZGzQZDR7unScTwfBwA4R1qAXwlGQ7K94p6FsS4bAAAA66iHAAD2R2asQXn-SImONQz5BBbsAABHFlNRAAA=.EML
Location: davmail.exchange.ews.EwsExchangeSession$Event.getEventContent(EwsExchangeSession.java:1751)
Thrown:
After deleting the offending event, vdirsync bombed out on another one. After deleting that event as well, syncing worked.
Maybe syncing could be made robust to such events? Catching an error around the event insertion and ignoring the problem instead of exiting?
To do this cleanly it requires a lot of changes in vdirsyncer. Also I worry about skipping few events (such that user doesn't notice and misses e.g. a meeting) a lot.
Activity
untitaker commentedon Aug 19, 2016
Further above there should be a "Normalized URL from" or "Already normalized". What does it look like?
sboehringer commentedon Aug 19, 2016
This would be the line:
Remove = from reserved chars
untitaker commentedon Aug 19, 2016
This should be fixed in master. If you want, you could try:
Then you have a working development version on
./fooenv/bin/vdirsyncer.untitaker commentedon Aug 20, 2016
0.12.1 is out, please reopen if this bug persists.
sboehringer commentedon Aug 25, 2016
Unfortunately, the error persists in version 0.12.1 in identical form.
DavMail is the CalDav server which is a Microsoft Exchange adaptor. As cadaver has a similar problem with showing the events with html-quoted characters, I am wondering whether is is really a DavMail bug. However, I would have a good idea as to how to proceed at the moment.
untitaker commentedon Aug 25, 2016
Is the forn absolutely identical? In particular the debugging lines about URL normalization (as asked above) interest me.
sboehringer commentedon Aug 25, 2016
The already normalized line occurs two times in the debug output. The "@" character is unquoted, the "=" is quoted.
Interestingly, the debug logs of DavMail do not show an access attempt to the event above. No errors are shown at all. This is different from cadaver that triggers errors in the DavMail server. Finally, Thunderbird works fine. Taken together, I would rather tend to assume an independent bug in vdirsync.
sboehringer commentedon Aug 25, 2016
Here is the davmail log from DavMail as given for a Thunderbird transaction (it is not the same event as I could not identify it). The EML-resources seem to be recurrent events. Thunderbird has quoted the "@" also.
untitaker commentedon Aug 25, 2016
Could you try adding
return xafter this line in your installation?sboehringer commentedon Aug 26, 2016
I did so and also inserted
above the
return x. The tail of the output ahead of the error message is given below. Theto_nativefunction does not appear to be unquoting the%3D(if i understand the meaning correctly). The error message stays exactly the same.sboehringer commentedon Aug 26, 2016
If I move the
return xbefore the...urlquoteline, and printorig_hrefandx, I get:sboehringer commentedon Aug 26, 2016
Finally, if not returning early, only printing
orig_hrefandx, I getsboehringer commentedon Aug 26, 2016
If I insert
from urllib.parse import quoteand replacewith
vdirsyncergets utterly confused, spewing errors on every message, e.g.sboehringer commentedon Aug 26, 2016
I believe that the problem is not due to mis-quoting. I got confused by the partial quoting of the URL but this seems to be handled well somehow, as the DavMail requests never results in an error. Also
vdirsyncerfetches a lot of events and only bails out later in the processing.According to DavMail the request looks as follows:
The response looks like:
I noticed, that in the request the string contains an
NRinstead ofNras in the urlsboehringer commentedon Aug 26, 2016
After deleting the offending event, vdirsync bombed out on another one. After deleting that event as well, syncing worked.
Maybe syncing could be made robust to such events? Catching an error around the event insertion and ignoring the problem instead of exiting?
untitaker commentedon Aug 26, 2016
To do this cleanly it requires a lot of changes in vdirsyncer. Also I worry about skipping few events (such that user doesn't notice and misses e.g. a meeting) a lot.