Open Bug 597998 Opened 14 years ago Updated 4 years ago

Can't add calendar with caldav:// URL [Exception "... failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]

Categories

(Calendar :: General, defect)

Lightning 1.0b2
x86_64
Linux
defect
Not set
major

Tracking

(Not tracked)

People

(Reporter: psychonaut, Unassigned)

References

()

Details

(Whiteboard: [workaround: comment 12])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.13) Gecko/20100914 SUSE/2.0.8-23.1 SeaMonkey/2.0.8
Build Identifier: 1.0b2rc3

It's impossible to add a calendar in Lightning.  After being prompted for the calendar name, hitting the "Next" button has no effect.

Reproducible: Always

Steps to Reproduce:
1. Install lightning
2. Right-click under "Calendar" and select "New Calendar..."
3. On the Network->Next
4. Format: CalDAV; under a caldav URL for the location; hit Next
5. Enter a name; hit Next
Actual Results:  
6. Nothing happens

Expected Results:  
6. The dialog should have gone to whatever step was next.

If you instead hit Cancel and restart Thunderbird, the calendar you attempted to add appears (unchecked) in the list of calendars.  However, it doesn't show any calendar entries, even when you check the box next to it, and even when you right-click on it and select "Reload Remote Calendars"
Sorry, step #4 above should have read "Enter a CalDAV URL", not "under a caldav URL".  Also, this bug occurs with Thunderbird 3.1.4.
Attached video Video showing bug —
I'd suggest that you check Error Console before and after the failure. Maybe there is an error message from Lightning providing more information. 

In addition please ensure that you are using the correct Lightning version. Lightning 1.0b2 doesn't support SeaMonkey. SeaMonkey 2.0.* is only supported by Lightning 1.0b1.
I am not using Lightning with SeaMonkey.  I mentioned in the report that this problem occurs with Thunderbird.

There is nothing relevant in the Error Console before and after installing Lightning.  Upon restarting Thunderbird, the only Lightning-related message in the error console is an informational message that it has (correctly) guessed my timezone.  There is also nothing at all output to the Error Console before and after trying to add a calendar, including when I click the "Next" button and nothing happens.  Upon restarting Thunderbird again, the following is output to the Error Console:

Error: uncaught exception: [Exception... "Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]"  nsresult: "0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)"  location: "JS frame :: file:///home/psy/.thunderbird/c28wje44.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calProviderUtils.jsm :: calPrepHttpChannel :: line 64"  data: no]

And then when I check the calendar I added and do a "Reload remote calendars", the following is output:

Error: Assert failed: [Exception... "Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]"  nsresult: "0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)"  location: "JS frame :: file:///home/psy/.thunderbird/c28wje44.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calProviderUtils.jsm :: calPrepHttpChannel :: line 64"  data: no]
2: [file:///home/psy/.thunderbird/c28wje44.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/components/calCompositeCalendar.js:365] cCC_refresh
3: [null:0] null
4: [chrome://calendar/content/calendar-common-sets.js:350] cC_doCommand
5: [null:0] null
6: [chrome://global/content/globalOverlay.js:96] goDoCommand
7: [chrome://messenger/content/messenger.xul:1] oncommand

Source File: file:///home/psy/.thunderbird/c28wje44.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calUtils.jsm -> file:///home/psy/.thunderbird/c28wje44.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calUtils.js
Line: 975
I can confirm this bug.
Client: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4

"Next" button is not clickable in creation dialog.
Calendar server is davical 0.9.7.6-0 from Ubuntu repository and Evolution 2.28.3 works perfect with it.

Error console shows:

Error: uncaught exception: [Exception... "Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]"  nsresult: "0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)"  location: "JS frame :: file:///home/username/.thunderbird/4vji94h1.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calProviderUtils.jsm :: calPrepHttpChannel :: line 64"  data: no]
We have to surround this bug :)

Can some of you please try to add a Google-calender, this
one uses CalDAV, too. Instructions can be found online.
Do not forget to create/activate the calender using the
Google internet page.

This works fine for me.

Can some of you tell an online accessible CalDAV
that the problem occurs with? 

I encountered similar problems if my calender uri was not
correct or if a calender using the same uri already existed...
I tried adding a Google calendar (using the "CalDAV" radio button, not the "Google" radio button) and it worked.  I noticed that the instructions on the Google Calendar page give the Calendar URL as starting with "https:" whereas for the calendar I tried to add in my original report I was specifying the URL as "caldav://localhost:1080/users/tmiller@inquira.com/calendar"  I'm not sure if caldav: is a standard URI scheme, but it's one that Evolution uses; I had simply copied and pasted my calendar URI from Evolution to Thunderbird.

With this in mind, I tried adding my calendar as http://localhost:1080/users/tmiller@inquira.com/calendar and it worked.

So it seems that the cause of this bug is really that Lightning chokes on caldav: URLs.  If caldav: is an official URI scheme, then Lightning should accept caldav: URLs!  If it's not an official URI scheme, then Lightning should either accept them anyway, or issue an error message saying the URL is invalid.  But it shouldn't behave in the way it currently does (i.e., accepting the URL as given, but then failing to proceed in the dialog after the next page).
It's not an official schema according to http://www.iana.org/assignments/uri-schemes.html. Neither is webcal: http://en.wikipedia.org/wiki/Webcal.
Still, I'd expect that Lightning handles them just like HTTP. There's nothing wrong with replacing caldav: with http: internally before making requests to the respective server. HOWEVER, how should Lightning know whether to use HTTP or HTTPS or do those two schemes imply HTTP?
I have seen webcal:// and webcals:// which might translate to http:// and https://. Installing a protocol handler that forwards to http(s) shouldn't be such an issue, but I believe there are other pieces of code, also outside of the calendar product, that relies on http-like connections having the standard protocol names.

Anyway, this needs investigation, but isn't currently a priority since the workaround is easy.
(In reply to comment #9)
> the workaround is easy.

Yes, once you realize you simply have to change the scheme manually when you enter it ;-) Lightning won't tell you but your favorite Internet search engine might.
I have a similar issue with Thunderbird 5 / Lightning 1.0b4. I have webcal:// calendars since Thunderbird 3 / Lightning 1.0b3 and it used to work fine.

Now I cannot edit the calendars URLs from the application, the fields are disabled. I looked at local.sqlite and cache.sqlite but could not find where the calendar URL are stored. Any idea? Thanks.

Here is the error I get:

[Exception... "Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]"  nsresult: "0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)"  location: "JS frame :: calICSCalendar.js :: <TOP_LEVEL> :: line 150"  data: no]
Quick workaround might be the following: Close Thunderbird. Open file "prefs.js" in the Thunderbird profile folder in a text editor. Locate the calendar URL preference and replace webcal with http.
Version: unspecified → Lightning 1.0b2
As a point of reference:  I had the same issue as noted in comment 11 (a previously working webcal:// calendar failed to load after upgrading to TB 5 / Lightning 1.0b4).  The fix suggested in comment 12 resolved the problem.
Tristan, do you still see this problem?
Summary: Can't add calendar → Can't add calendar. Error: uncaught exception: [Exception... "... failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]
Whiteboard: [workaround: comment 12]
Yes, this still occurs with Thunderbird 7.0.1 and Lightning 1.0b7, running on Ubuntu 10.04 for x86-64.
Reading previous comments I'd say the error is still expected if you use the unknown caldav:// protocol.
Summary: Can't add calendar. Error: uncaught exception: [Exception... "... failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI] → Can't add calendar with caldav:// URL [Exception "... failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIIOService2.newChannelFromURI]
We could likely do the same we did for webcal://, but we'd need to make sure that the caldav provider can also cope with this. I believe there are some places where http(s) is expected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Why not simply automatically replace caldav:// with http://?  Or else pop up an error dialog indicating that caldav:// is not a recognized URI scheme, and suggesting the user try http:// or https:// instead.
I see this is a few years old, but I too have this prolem except for ics format.
Component: Lightning Only → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: