Skip to content
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

Request mechanism to debug "multiple items with the same UID" #1093

Open
SethRobertson opened this issue Oct 12, 2023 · 3 comments
Open

Request mechanism to debug "multiple items with the same UID" #1093

SethRobertson opened this issue Oct 12, 2023 · 3 comments

Comments

@SethRobertson
Copy link

  • vdirsyncer 0.19.2 on python 3.11.5, Fedora 37
  • Syncing to davmail

I recently started having vdirsyncer "sync" failure and the system threw up an error about "multiple items with the same UID" (aka IdentConflict). I've had this once before, but I didn't have a good experience recovering from that with repair and/or other things I did trying to resolve the problem in my ignorance.

This time I wanted to know what event or events were bad before anything else. However, figuring this out was non-obvious. The path-like names didn't convey any information. I instrumented the code to dump href, etag, and ident; but again this did not reveal any information and looking at previously stored files and contents did not turn up any of these strings.

Finally, I put something in dav.py in the get_multi function to print out all objects href, raw, and etag. Finally I was able to cross-reference the href that was marked as failed against something useful (a pretty opaque "raw" description of the event). This let me figure out what event it was and I decided I didn't care about the duplicated events and nuked them from the server using the native client (fortunately an option for me).

Providing a mechanism to dump this "raw" data when we get this duplicate UID would make life much better if someone else (or me, a few months from now) encounters this server-side issue to allow more clarity on the problem. Issue #210 would be another to possibly resolve the issue.

Don't get me wrong, if you wanted to figure out some magic to understand that the events were distinct (or identical, it was day one and day two of an event that someone probably created in a weird way) to avoid the problem, all the better. But providing enough information to let humans figure out what is wrong is a good first step.

Thanks for the software, it makes my life much much better.

@WhyNotHugo
Copy link
Member

As part of the rewriting process, I've also written a small command line tool that is designed for this general purpose: interactively inspect a remote caldav storage:

https://git.sr.ht/~whynothugo/vdirsyncer-rs/tree/main/item/davcli/README.md

Right now you can list items and fetch them with (albeit one at a time, at least for now). It's a very low-level tool, but you should be able to write a tiny script that fetches all items and prints their UID.

@WhyNotHugo
Copy link
Member

Better tools for this kind of thing are obviously on my radar: fixing the "duplicate UID" scenario is definitely on my roadmap.

@SethRobertson
Copy link
Author

Thanks for the pointer to the davcli tool. I knew you had to have some kind of debugging tool somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants