xandikos icon indicating copy to clipboard operation
xandikos copied to clipboard

Evolution cannot write to calendar: Precondition failed

Open tusj opened this issue 6 years ago • 10 comments

I am testing xandikos with evolution, and seem to be unable to write a new appointment with evolution. I am running xandikos like this: xandikos --defaults -d $HOME/dav --listen 0.0.0.0

Evolution complains: Failed to create an event in the calendar “CalDAV : calendar” Cannot create calendar object: Failed to put data: HTTP error code 412 (Precondition Failed): Not a valid calendar file.

The error in xandikos' output is this: WARNING:root:invalidly formatted href: http://localhost:8080/user/calendars/calendar/21921634061cd33d66946f8e2005900c17b9d5cf.ics

tusj avatar Aug 08 '18 10:08 tusj

The icalendar python module has trouble parsing the icalendar file that evolution is trying to upload.

Can you try running the version from HEAD? I've changed Xandikos so it includes the actual error message from parsing.

jelmer avatar Aug 08 '18 21:08 jelmer

Here you go, this is again from Evolution when creating an appointment:

Cannot create calendar object: Failed to put data: HTTP error code 412 (Precondition Failed):
Not a valid calendar file: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware

tusj avatar Aug 09 '18 07:08 tusj

Thanks, that helps a lot. This appears to be related to a change in dateutil, which is used by the icalendar package that xandikos uses to parse icalendar files.

The relevant upstream change is https://github.com/dateutil/dateutil/pull/634

jelmer avatar Aug 09 '18 10:08 jelmer

Presumably this is actually a bug in how evolution writes its icalendar files; I'll see if there is anything we can do to allow files that are somewhat broken.

One temporary workaround is to install a version of dateutil before 2.7.1. I'm running 2.6.1 myself, which is why I haven't run into any issues with evolution so far.

jelmer avatar Aug 09 '18 10:08 jelmer

I was running dateutil 2.7.3.

I have seen the href error pop up in the xandikos logs when setting up KOrganizer as well. It seems that some of my .ics files are invalid, according to icalendar.org. However, when parsing those files with python icalendar (using dateutil) I found no complaints. I did susbsitute dateutil with 2.6.1 with pip install python-dateutil==2.6.1 which did not resolve the href complaints upon synchronization with KOrganizer. Synchronization with Thunderbird and Evolution seems to work fine though.

Edit: I was unable to see any of my events in KOrganizer, but thought it was due to some error in KOrganizer itself. I can now confirm that I see no events here because the href error affects all my calendar files.

Edit: This also affects all my contacts, no contacts are displayed in KOrganizer.

tusj avatar Aug 09 '18 11:08 tusj

On Thu, Aug 09, 2018 at 04:14:54AM -0700, Sindre Føring Devik wrote:

I was running dateutil 2.7.3.

I have seen the href error pop up in the xandikos logs when setting up KOrganizer as well. It seems that some of my .ics files are invalid, according to icalendar.org. However, when parsing those files with python icalendar (using dateutil) I found no complaints. I did susbsitute dateutil with 2.6.1 with pip install python-dateutil==2.6.1 which did not resolve the href complaints upon synchronization with KOrganizer. Synchronization with Thunderbird and Evolution seems to work fine though.

The href complaints are unrelated, and harmless. Xandikos shouldn't trigger this warning for clients that send full URLs. I've filed #81 about this.

-- Jelmer Vernooij [email protected] PGP Key: https://www.jelmer.uk/D729A457.asc

jelmer avatar Aug 10 '18 11:08 jelmer

Hi guys, when I was running a test installation in an lxc container (debian) I ran into the same error you were writing above. However, my other caldav clients work properly and I don't need to use evolution, so I decided to use it on my production server.

Now, a couple of days later, when I finished the production setup, it seemed that also evolution is able to create appointments successfully... I queried the package version of dateutil in the arch repo:

# pacman -Ss dateutil
community/python-dateutil 2.7.3-2 [Installiert]
#  python3 -c "import dateutil; print(dateutil.__version__)"
2.7.3

I'll be looking for further information on this when I find some spare time...

0x646f6d avatar Sep 25 '18 10:09 0x646f6d

FTR, upgrading to a new dateutil (>= 2.7.3) should fix this.

jelmer avatar Dec 28 '18 15:12 jelmer

Doing some more testing, with dateutil == 2.7.5 and Evolution 3.30.4 gives:

  • Whole day event without start and end time is working
  • Specifying start time and end time is not working with same error message as previously shown

Edit: This behaviour is also experienced on gnome-calendar, but that is to be expected, since I believe gnome-calendar uses the same backend as Evolution.

tusj avatar Jan 13 '19 17:01 tusj

Ah, that's a pity. I must have tried it with a configuration that did work. :(

jelmer avatar Jan 13 '19 19:01 jelmer