Closed tenpast closed 1 year ago
I have the same problem from time to time with a similar setup. In my case, it is oftentimes for already synced org entries for which I added a tag afterwards which is specifically excluded from the export via org-caldav-exclude-tags
. The relevant entry is still present in the org file and not present in the Nextcloud calendar - as it should be. However, it is also still present in the org-caldav sync state file even though it was excluded later on. Maybe that is the issue?
Though it does not cause the error every time and you also did not use this variable in your setup, so I am not sure what the exact problem is.
My fix was to delete the local sync state files and resync everything again.
Thanks for your comment. After writing this issue I left Emacs open with the timer running, and by the next morning it was syncing fine. Since then, I've been using org-caldav, adding tasks both on Org Mode and Nextcloud. Every now and then it complains about a missing UID, but then it eventually clears up and syncs.
It would be preferable not to get the error message, but so far it's quite usable in spite of the error.
In my case, the UID it complained about when I opened the issue was definitely for a task present in both the Org and Nextcloud calendars.
I'll post updates if I figure out what's causing this, if it becomes unusable or if I stop receiving the error.
@tenpast Possibly it is related to the org-mode file not being saved after sync'ing.
In last couple years, org-id changed so that it can only reliably find IDs in saved org files (it won't always find new IDs in unsaved buffers). To work around this, I added some code so that org-caldav will save the org buffer at several points during sync (e.g. after inserting new entries/IDs). However there may be some gaps -- I occasionally notice that the Org file had some unsaved changes after sync, and Org won't find the new IDs until after it's saved. Subsequent sync's will save the new changes, so maybe that's why the problem goes away.
You can try adding (org-save-all-org-buffers)
after sync in your timer, to see if it fixes the issue.
You can try adding
(org-save-all-org-buffers)
after sync in your timer, to see if it fixes the issue.
Thank you for the recommendation @jackkamm, I'll try this out!
I believe I fixed the problem in the latest commit and have closed the issue. Please re-open if you experience the problem again after updating.
Yesterday I posted on Issue #230 thinking I had resolved the problem, but this turns out not to be the case.
The workaround explained on that post worked to achieve a first sync (adding the file to
org-id-files
by creating an ID manually and then deleting it). However, on subsequent syncs I end up getting aCould not find UID 20230501T092828.997173
error. I'm including the ID number in case this makes a difference, as I have set it to ISO time format.Once this error happens, the only way to re-sync is to delete the calendars on Nextcloud, restore from a backup made prior to syncing with
org-caldav
, usingorg-caldav-delete-everything
and starting again.Relevant software:
Current configuration: