-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync against davmail results in several 'Server sent item twice' and an exception #144
Comments
This issue has come up before with a different server. It basically boils down to whether hrefs are case-sensitive or not, and the way I interpret the CalDAV RFC, they aren't supposed to be. I'd be interested in how Thunderbird handles this, and how @dmfs deals with this situation. |
Also this seems to be a common phenomenon with Windows-based (or tangentially Microsoft-related) services? |
I'd say yes and no to the windows related comment. The behavior in KCalendar / akonadi which I suspect is caused by this has been present for me no matter whether my mailbox was hosted on zimbra or exchange - it has been migrated a few times, and this has always occurred, though admittedly I can't actually verify that we're talking about the exact same cause. |
Also, I'd agree they aren't supposed to be case sensitive, especially given that the actual retrieved files seem to be identical. In that case, couldn't duplicate case differing entries be handled a bit more gracefully? |
Eugh, sorry for mentioning you again dmfs, I re-read the old thread at #113 and saw you didn't see any issues either. @benklop Do you have any possibility of capturing the requests made to your server? I think davmail has an option for this (not sure if you can reproduce the issue with that), otherwise mitmproxy should be able to do this. |
I already thought about introducing a new parameter for case-insensitive behavior. I am very vary about making this the default because different cases might actually mean different items (better fail hard than fai silently) |
@untitaker if you can give me some suggestions on how to make davmail capture the requests, I can certainly provide that, possibly scrubbed a bit, depending on the included data. I am currently reproducing this through davmail, so that would be a convenient capture method. |
@untitaker I would certainly expect any such parameter would definitely not be the default; I couldn't imagine that being a good idea. |
Minimally configured davmail drops a "davmail.log" into my homefolder (or CWD?) You can change the path in the settings. |
@untitaker no problem.
It doesn't mention the path. Of course it doesn't explicitly say the path would be case-insensitive, but it does say that about scheme and host (not just in this section, but in other places as well). That leads me to the conclusion that the path is indeed case-sensitive and I think that's how most web servers and HTTP clients handle it. |
That's also how Java's URI class compares URIs. Only scheme and host are compared in a case-insensitive manner. |
Yeah the HTTP and URI specs are definetly case-sensitive, I thought this behavior could be Web/Cal/CardDAV-specific. I think I will have to implement a case-sensitivity parameter for the DAV storages. |
@untitaker I've enabled debug level logging in davmail, and ran a vdirsyncer sync, the log contains a pretty fair amount of sensitive data, however. No passwords, but a lot of email addresses and the contents of all the appointments. I can probably use sed to make this a lot better, but i don't want to get rid of anything you'd need. |
The content of the iCalendar files don't matter I think. Anything that is XML is important, but may be censored. |
Oh, I meant running Thunderbird against it to see how it deals with this situation. |
@untitaker let me know if you'd like the logging data and I can provide it to you offline. it doesn't seem particularly feasable to sanitize it, unfortunately. |
@benklop I forgot about this: Could you try using the vdirsyncer version from the
and install vdirsyncer like this:
|
@untitaker well, i got a whole lot of 'skipping identical href', then eventually:
|
Could you re-run this with |
Actually it would be more helpful if you send it to the email address on my profile. Thank you! |
@benklop Any update on this? |
@untitaker sorry about that, had a very busy few days. given the huge mass of XML in the end of the output, I think i'm going to send you a little more than 10 lines :) Briefly, the last several pages of output seem to be a gigantic amount of XML containing:
for lots of different .eml resources. I'm fairly certain all of them are getting a 404. |
From earlier in the log, it looks like the case sensitive href is:
From this I can only assume that the server is in fact not case insensitive. Looking back at the previous data about the files that did cause an issue, I grabbed the first problem URL from my initial report and started changing the case of various characters. Certain parts seem to be case sensitive, but not others. Everything before the second dash seems case sensitive, while everything after does not.
seems equivalent to
but not for every entry, unfortunately.
does not work, for instance. The only URLs I've noticed that seem to be partially case insensitive are ones that contain an underscore near the end. |
@benklop Can you verify that all case-variations of one href actually represent the same item (return same content on GET request) |
diff claims the variations on the same hrefs that are retrievable lead to the same files. |
Could you re-try:
|
The updates I made to that branch don't actually try to generate the "correct" href, instead it relies on the server sending two responses for each href, which seems to be the case here. |
unfortunately it seems to fail with the same problem as before. I won't be able to resume troubleshooting this until tomorrow or next week, unfortunately. After the large block of XML with 404s, the traceback is:
the hrefs in the last block of XML are all lower case still. |
That's highly irritating, I just added code to catch exactly that exception. The exception from the threading module seems like an unrelated heisenbug. Are you sure this is happening always? |
I just tried this with my own Office365 account and while vdirsyncer yields a lot of warnings due to duplicate hrefs, synchronization works just fine. |
During testing I also fixed some unrelated bugs, and I am surprised you didn't run into those. The |
@untitaker it's possible somehow the executable didn't actually update to the newer code you pushed... I don't seem to be able to restore it to its original state either. I'll work on that next week. |
I edited history in the branch. Easiest way to get around it is to reclone the repo. I'll avoid doing that for now. |
@benklop It seems I didn't correctly push my changes, please try again. |
Just to acknowledge untitakers comment: I tried with version 4.5.1 and the master branch of vdirsyncer. It works without any problems. |
Closing due to inactivity. |
I know this is an old issue but I still have the problem with the latest DavMail (4.7.3-2438). Would you consider reopening it? Basically, the first run will return the following calendar events:
While the second one will return the following (notice the upper case
I couldn't find anything in the DavMail logs (this is always in lower case). Currently, I fixed the problem by removing the exception risen if the key match in lower case. |
Could you try with 4.5.1? |
Also tbh this really should be filed against DavMail |
In 4.5.0, I have this error:
Between 4.5.1 and 4.6.1 I have a NullPointerException in DavMail. After that, I have the same behavior than the latest. I tested all version from 4.5.0 to 4.7.3 except for 4.7.0 and 4.7.1 (I used the deb packages). You are right, I will try to fix this problem on DavMail side. Also, this might come from Outlook. I have other problems with it like repeated event not repeating the event title, leading to empty event in khal. Anyway, thank you for this great tool. |
For that error there's a repair tool by Microsoft linked in the vdirsyncer docs |
Thanks for the tip, I'll try that tomorrow at work. |
I've been trying to figure out why kcalendar / akonadi is missing some of my appointments, but thunderbird's calendar component, lightning, is not missing them. As part of this troubleshooting, I decided to use vdirsyncer to more easily examine the data the clients are being sent.
Upon trying to sync, I got this output:
In order to see what was going on a little better, I decided to change the exception raise to a warning:
dav.py line 344:
This gave me the output:
This of course had an exception after that, ( SyncError: Etag changed during sync. ) so that isn't a solution, but it does show something interesting.
The server appears to be mixing the case of the 3rd character in the last portion of the name:
So it looks to me like in these last 6-7 characters, case doesn't seem to be consistent, and entries seem to be present for both. I have checked a couple of these, and the actual file retrieved seems to be identical for both entries.
I'm not sure at this point how to fix this in vdirsyncer - I'm not really a python developer.
The text was updated successfully, but these errors were encountered: