Bug 1317270 - [CalDAV] Use timezone location as tzid for iCloud.com
[CalDAV] Use timezone location as tzid for iCloud.com
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: evolution-data-server (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Milan Crha
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-13 12:03 EDT by Tibbs Brookside
Modified: 2016-03-25 16:03 EDT (History)
4 users (show)

See Also:
Fixed In Version: evolution-data-server-3.20.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-22 09:50:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Debug log when trying to add appointment to iCloud calendar. (31.41 KB, text/plain)
2016-03-13 12:03 EDT, Tibbs Brookside
no flags Details
Debug log when trying to add appointment to fruux calendar. (33.91 KB, text/plain)
2016-03-13 12:04 EDT, Tibbs Brookside
no flags Details
Debug log when trying to add appointment to iCloud calendar in F24. (4.47 KB, text/plain)
2016-03-15 09:46 EDT, Tibbs Brookside
no flags Details
ics file created in Evolution that won't be accepted by iCloud (14.00 KB, text/plain)
2016-03-21 20:28 EDT, Tibbs Brookside
no flags Details
ics file created in Thunderbird that will be accepted by iCloud (3.26 KB, text/plain)
2016-03-21 20:29 EDT, Tibbs Brookside
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 764027 None None None 2016-03-22 09:50 EDT

  None (edit)
Description Tibbs Brookside 2016-03-13 12:03:35 EDT
Created attachment 1135905 [details]
Debug log when trying to add appointment to iCloud calendar.

Description of problem:
I have added two CalDAV calendars to Evolution. One is using the fruux service and one is using the iCloud service. Adding and viewing the calendars works fine. Once added I can add / change / remove appointments in the fruux calendar fine, but any attempt to add / change / remove appointments in the iCloud calendar causes numerous re-authentication prompts and then fails.

Version-Release number of selected component (if applicable):
evolution-3.18.5.1-1.fc23.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Add iCloud calendar to Evolution.
2. Create a new appointment (Evolution prompts for authentication).
3. Save new appointment (Evolution prompts for authentication).
4. Receive "Cannot create calendar object: Authentication Required" message.

Actual results:
Unable to create appointment.

Expected results:
New appointment created.

Additional info:
Comment 1 Tibbs Brookside 2016-03-13 12:04 EDT
Created attachment 1135906 [details]
Debug log when trying to add appointment to fruux calendar.
Comment 2 Milan Crha 2016-03-14 12:19:27 EDT
Thanks for a bug report. I tried to create a new Apple ID and reproduce this, but I do not get past the login to the CalDAV server (it seems my Apple account doesn't have CalDAV enabled or something like that). In any case, the evolution-data server writes the same data to your both servers, the difference is that the iCloud server thinks the pushed component is not valid, but doesn't tell what precisely it dislikes on it.

The log after the PUT attempt says:
> < HTTP/1.1 403 Forbidden
> < ...
> <
> < <?xml version='1.0' encoding='UTF-8'?><error xmlns='DAV:'>
>   <valid-calendar-object-resource xmlns='urn:ietf:params:xml:ns:caldav'/>
> </error>

I found a similar question here:
http://stackoverflow.com/questions/34757506/403-caldav-error-valid-calendar-object-resource

As far as I can tell, the issues mentioned in that post are not applicable to what the evolution-data-server does. Maybe it's about those expanded time zones. I'd suggest to try with the to-be-Fedora-24 release, in a virtual machine, because it contains libical 2.0 which has this timezone expansion disabled. This libical cannot be easily updated in the previous Fedora releases, because it requires rebuilds (and eventually changes) of all the packages which are using it.
Comment 3 Tibbs Brookside 2016-03-14 12:54:55 EDT
Thanks for the response. For info, when you authenticate to the iCloud CalDAV / CardDAV server, you have to use your full email address (unlike the iCloud IMAP server where you just use the name part of your email address).

I'll give Fedora 24 a go as a VM and see what happens.

I forgot to mention that Thunderbird (Lightning) works fine with the iCloud CalDAV server.
Comment 4 Milan Crha 2016-03-14 13:07:58 EDT
(In reply to Carrot Cruncher from comment #3)
> Thanks for the response. For info, when you authenticate to the iCloud
> CalDAV / CardDAV server, you have to use your full email address (unlike the
> iCloud IMAP server where you just use the name part of your email address).

Correct, I did it, but I was still rejected. My iCloud.com Web interface also doesn't offer me contacts or calendars, which might or might not be part of the issue on my side. I do not know.

> I'll give Fedora 24 a go as a VM and see what happens.

Thanks.

> I forgot to mention that Thunderbird (Lightning) works fine with the iCloud
> CalDAV server.

I suppose it's either due to those expanded time zones, or due to the file name being used for the PUT request. The error itself doesn't tell much detailed information, unfortunately.
Comment 5 Tibbs Brookside 2016-03-15 09:46 EDT
Created attachment 1136606 [details]
Debug log when trying to add appointment to iCloud calendar in F24.

Unfortunately it doesn't appear to work in F24 either.
Comment 6 Milan Crha 2016-03-15 13:29:48 EDT
Thanks for the update and trying this with the latest evolution. I appreciate it. I created mu iCloud account yesterday, but they do not want to let me use the Calendar/Contacts parts (the WebDAV based interface). When I login to the web interface of the iCloud.com, then they offer me only Pages, Numbers, Keynote and Settings, but no Calendar nor Contacts. I do not know how to enable it.

When I try to access caldav.icloud.com, I'm simply rejected, which I think has something to do with the iCloud interface not showing me those two parts. If you want to try what I did, then I run the evolution as:
   $ WEBDAV_DEBUG=all evolution
then I do:
a) File->New->Calendar
b) choose CalDAV type
c) into the URL fill: https://caldav.icloud.com
d) into the Username fill your username for the iCloud server (I filled my
   whole email address, basically my Apple ID)
e) click Find Calendars button

And now check the console of the evolution. It tries couple things, then fails and asks for the password. That's expected. I give it the same password I used for the web UI and it tries the same steps again, this time with
> Authorization: Basic [...]
header added. The attempt fails again for me, with an error Unauthorized, and the explanation (which is not shown in the Evolution UI):

> <html><head><title>Unauthorized</title></head><body><h1>Unauthorized</h1>
> <p>You are not authorized to access this resource.</p></body></html>

Maybe they require a valid login to the account using an iPhone or similar iDevice, which I do not have, unfortunately. The server also advertises in the SRV records these services (interesting for the evolution-data-server):

   imaps: imap.mail.me.com:993 priority:0 weight:1
   submission: smtp.mail.me.com:587 priority:0 weight:1
   caldavs: caldav.icloud.com:443 priority:0 weight:0
   carddavs: contacts.icloud.com:443 priority:0 weight:0

but even if I tried the caldavs URL (and port actually), then the server rejects me the same way. I mean with all this that i would like to test this locally, but I cannot - they do not want to let me.
Comment 7 Tibbs Brookside 2016-03-15 16:57:17 EDT
As you say, you need to access your iCloud account from an Apple device at least once to get access to all the services:
https://support.apple.com/en-gb/HT204174
Comment 8 Tibbs Brookside 2016-03-21 20:28 EDT
Created attachment 1138853 [details]
ics file created in Evolution that won't be accepted by iCloud

Having done some further testing, it would appear that the iCloud CalDAV server doesn't like it if you use any timezone other than UTC.

Attached are two ics files that both have the timezone set to America/Denver (just to test).

evolution.ics is an entry created in Evolution, on a different CalDAV server, that I can't copy to iCloud.

thunderbird.ics is an entry created in Thunderbird, on a different CalDAV server, that I can copy to iCloud.
Comment 9 Tibbs Brookside 2016-03-21 20:29 EDT
Created attachment 1138854 [details]
ics file created in Thunderbird that will be accepted by iCloud
Comment 10 Tibbs Brookside 2016-03-21 20:31:33 EDT
Just to clarify me previous statement:

Having done some further testing, it would appear that the iCloud CalDAV server doesn't like it if you use any timezone other than UTC.

should read:

Having done some further testing, it would appear that the iCloud CalDAV server doesn't like it if you use any timezone in Evolution other than UTC.
Comment 11 Milan Crha 2016-03-22 04:34:25 EDT
Thanks for the update. I managed to enable calendar for my iCloud account yesterday (a colleague helped me with it), thus I can also reproduce this locally.

Your finding about the timezone is interesting. That's a wrong idea to write events without timezone, it's against the RFC, as far as I know. I see that the thunderbird event contains timezone too, similarly what the evolution uses.

Further investigation led me to that the iCloud server doesn't like the TZID value evolution uses.

While Thunderbird uses location as the timezone ID (America/Denver in your case), the Evolution uses the timezone ID as returned by libical, which is
/freeassociation.sourceforge.net/America/Denver. Using location instead of timezone ID makes iCloud CalDAV server happy.

I'll check further what can be done to fix this properly, my quick changes were more about a quick hack to find out what the issue is.
Comment 12 Milan Crha 2016-03-22 09:50:35 EDT
I fixed this upstream within bug [1], where I referenced this bug report. It's better to have it filled upstream, for easier searching and such. The fix will be available in the evolution-data-server-3.20.1+.

Thank you for your help with this.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=764027
Comment 13 Tibbs Brookside 2016-03-25 16:03:17 EDT
Many thanks. Much appreciated.

Note You need to log in before you can comment on or make changes to this bug.