Re: [O] org-caldav: Syncing Error: Could not find UID...

2013-12-10 Thread Detlef Steuer
Hi!

I spent most of yesterday afternoon on toying with org-caldav.

It came out as a more or less frustrating afternoon.

A while (a year?) ago I had setup a _working_ script to export multiple
calendars to owncloud. Owncloud wasn´t stable enough at that time, so I
stopped using it. Now I´m trying to setup a department cloud and
use it again. 

Two (small) of my three org files are exported fine as expected.
That means it works in principle.

The third (large) file gives a lot of problems.

1. I had the same error message as Daniel. I remember my critical UID
   beginning with TS10, too. Strange. 

2. _All_ headlines get IDs. Not only those with an active time stamp.
   The note to self Do experiments on copies only now has red color
   and an increased font size.  

3. While stepping through my script line by line I saw some R and lisp
   Code executed by org-babel while exporting calendar data. That was
   unexpected for me and  I *believe* that was related to the UID error.
   I am not sure, but at one point it *once* exported my ToDos,
   afterwards returning the good old UID error.
   (org-caldav-delete-everything) didn´t change a thing here,
   too.
 
All components used were recent git pulls.

Because I tried more an more things with increasing levels of impatience
I have no useful logs, but I at least want to confirm Daniels problems. 

Here is my setup for export  (HOSTNAME replaced):

=== Todo.el
(add-to-list 'load-path ~/GIT/org-mode/lisp/)
(require 'org)

(setq org-icalendar-include-todo t)
(setq org-icalendar-use-deadline '(todo-due))
(setq org-icalendar-use-scheduled '(event-if-not-todo))

(require 'auth-source)
(setq auth-sources '((:source ~/.netrc :host t :protocol t)))
(setq auth-source-debug t)

(add-to-list 'load-path ~/GIT/org-caldav/)
(setq org-caldav-url
https://HOSTNAME/owncloud/remote.php/caldav/calendars/steuer;)
(setq org-caldav-calendar-id todo) 
(setq org-caldav-files '(~/.pim/todo.org) ) 
(setq org-caldav-inbox ~/.pim/caldav-inbox.org) 
(require 'org-caldav) 
(org-caldav-sync)

===

This is called with:

emacs --batch --load ${HOME}/Scripts/Todo.el

inside a larger script.

When I find time I´ll construct a minimal example, but not today.

Any hints very appreciated.

Detlef



Am Fri, 06 Dec 2013 13:13:35 +0100
schrieb Daniel Thom d...@netbunker.de:

 Hi,
 
 because of this error i switched from owncloud to baikal. But the
 error stays the same
 
 Every sync aborts with the message:
 Could not find UID TS10-aa7e8257-c44f-47ef-b8ac-eb72130b8156.
 
 The Message Buffer says:
 Duplicate ID 29b80a9d-597d-459e-bea5-f5f671b59ea5, also in file
 .
 .
 
 WARNING: 28 duplicate IDs found, check Messages buffer
 progn: Could not find UID TS10-aa7e8257-c44f-47ef-b8ac-eb72130b8156.
 
 I have also run C-u M-x org-caldav-delete-everything but it changed
 nothing. :-(
 
 How can i solve this error?
 
 Emacs Version: GNU Emacs 24.3.50.1
 orgmode Version: Org-mode version 8.2.1
 org-caldav: fresh install (git clone)
 






Re: [O] org-caldav: Syncing Error: Could not find UID...

2013-12-10 Thread Eric S Fraga
Detlef Steuer detlef.ste...@gmx.de writes:

 Hi!

 I spent most of yesterday afternoon on toying with org-caldav.

[...]

 The third (large) file gives a lot of problems.

 1. I had the same error message as Daniel. I remember my critical UID
beginning with TS10, too. Strange. 

Detlef  Daniel,

I remember having to make a change to org-caldav.el to cater for digits
after the two capital letters, as in TS9-  That change was:

--8---cut here---start-8---
diff --git a/org-caldav.el b/org-caldav.el
index 0383366..cd5b273 100644
--- a/org-caldav.el
+++ b/org-caldav.el
@@ -786,7 +786,7 @@ is no UID to rewrite. Returns the UID.
  ((re-search-forward ^UID:\\(orgsexp-[0-9]+\\) nil t)
   ;; This is a sexp entry, so do nothing.
   (match-string 1))
- ((re-search-forward ^UID:\\(\\s-*\\)\\([A-Z][A-Z]-\\)?\\(.+\\)\\s-*$
+ ((re-search-forward 
^UID:\\(\\s-*\\)\\([A-Z][A-Z][0-9]-\\)?\\(.+\\)\\s-*$
 nil t)
   (when (match-string 1)
(replace-match  nil nil nil 1))
--8---cut here---end---8---

I believe this change was incorporated into org-caldav.el but I am
currently on a system which has not been updated in a while.  In any
case, I wonder if the change could be:

+ ((re-search-forward 
^UID:\\(\\s-*\\)\\([A-Z][A-Z][0-9]*-\\)?\\(.+\\)\\s-*$

instead, adding a * to the digit match to cater for any number of
digits after the two capital letters?

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.4-322-gece429