Open Bug 486773 Opened 15 years ago Updated 2 years ago

Ambiguous error - "Failed to parse item:"

Categories

(Calendar :: Provider: CalDAV, defect)

defect

Tracking

(Not tracked)

People

(Reporter: aapthorp, Unassigned)

Details

(Whiteboard: [calconnect31])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Lightning 1.0 pre 20090403

The error message "Failed to parse item:" is ambiguous and does not help detect th e source of the error. This error message is raised in two places and does not detail the cause of specific parsing problem.

This error is consistently logged when parsing certain but not all CalDav response (VTODO) items. The failed items are successfully parsed in Lightning 0.9.

Reproducible: Always

Steps to Reproduce:
1.Configure lightning to retrieve CalDav calendar
2.Error can be observed in error console as lightning loads calendar from CalDav server.
Actual Results:  
Example response:

Warning: Failed to parse item: <D:response xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
  <D:href>http://localhost:8080/taskcal-dav/user/calendar/tasks/62.ics</D:href>
  <D:propstat>
    <D:prop>
      <D:getetag>"20090222T112344-62"</D:getetag>
      <C:calendar-data>BEGIN:VCALENDAR
PRODID:-//aapthorp//jBPM iCal wrapper//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VTODO
DTSTAMP:20090403T215123Z
DTSTART;TZID=Europe/Prague:20090225T120000
DUE;TZID=Europe/Prague:20090225T160000
SUMMARY:collect shipment - 62
CREATED:20090222T102248Z
STATUS:NEEDS-ACTION
ATTACH:http://localhost:8080/jbpm-console/sa/task.jsf?id=62
LOCATION:Somewhere
LAST-MODIFIED:20090222T112344
CONTACT:someone
UID:20090222T102248Z-62@LEONARDO
PRIORITY:3
DESCRIPTION:Task 'collect shipment' has been assigned to you. It's due at 2
 5/02/2009 16:00 so go for it: 62 Thanks.
CATEGORIES:collect shipment
ATTACH;ENCODING=BASE64;VALUE=BINARY;FMTTYPE=text/html:PEhUTUw+PEJPRFk+PFBSR
 SBzdHlsZT0iZm9udC1mYW1pb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 WFuIiAvPjxodG1sOmJyIC8+PC9odG1sOnRkPjwvaHRtbDp0cj48aHRtbDp0cj48aHRtbDp0ZCB
 2YWxpZ249InRvcCI+QzpEVFNUQVJUPC9odG1sOnRkPjxodG1sOnRkIHZhbGlnbj0idG9wIj48a
 HRtbDppbnB1dCB0eXBlPSJ0ZXh0IiBuYW1lPSJDOkRUU1RBUlQiIHZhbHVlPSIyMDA5LTAyLTI
 1IDEyOjAwOjAwLjAiIC8+PGh0bWw6YnIgLz48L2h0bWw6dGQ+PC9odG1sOnRyPjwvaHRtbDp0Y
 m9keT48L2h0bWw6dGFibGU+PC9QUkU+PC9CT0RZPjwvSFRNTD4=
ORGANIZER:MAILTO:jbpm@xxx.yyy.com
URL:http://localhost:8080/taskcal-dav/user/calendar/tasks/62.ics
ATTENDEE;CN=user;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAIL
 TO:user@xxx.yyy.com
END:VTODO
END:VCALENDAR</C:calendar-data>
    </D:prop>
    <D:status>HTTP/1.1 200 OK</D:status>
  </D:propstat>
</D:response>

Expected Results:  
Item should be successully parsed as it is with Lightning 0.9.
Theoretically, an event that fails to parse (i.e throws an exception there) should cause 0.9 to stop parsing any further events. The error message you are getting happens when the ics parser can't parse the vcalendar. Not quite sure why this happes yet. The validator at http://severinghaus.org/projects/icv/ says the file is valid as soon as you remove the two ATTACH properties (but thats likely a bug in the validator). Saving that snippet as an ICS file and loading in lightning works for me, so I'm not quite sure yet why this fails in caldav.

One thing I noticed is that a timezone is referenced (Europe/Prague), but the calendar-data doesn't provide a timezone definition for Europe/Prague.
Trying to import only the iCalendar part into storage calendar fails with:

Error: DB error: not an error
exc: TypeError: att.uri is null

Error: Import error: [Exception... "'[JavaScript Error: "att.uri is null" {file: "file:///E:/sunbird/calendar-js/calStorageCalendar.js" line: 2699}]' when calling method: [calICalendar::addItem]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://calendar/content/import-export.js :: putItemsIntoCal :: line 205"  data: yes]
Source File: chrome://calendar/content/import-export.js Line: 213

Maybe caldav providers encounters a similar error or the same error if storage provider (experimental cache feature?) is involved?
Reporter, have you enabled the experimental cache feature for the calendar? 
If yes I'd like you to retest with disabled cache.
Attached patch [checked in] graceful import — — Splinter Review
At least the import problem mentioned in comment #2 looks like a code bug: We yet don't support inline attachments, and should be graceful when importing (filtering those out).
Attachment #371145 - Flags: review?(ssitter)
To <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=486773#c3">comment #3</a>, no the cache is disabled.

To <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=486773#c1">comment #1</a>, this item is the same structure of ones that parse OK including the timezone issue.

When I look at the source this error message can be logged for two different errors (hence original bug report). I'm assuming it's the parser error and not the issue with number of items.
Comment on attachment 371145 [details] [diff] [review]
[checked in] graceful import

>diff --git a/calendar/base/src/calItemBase.js b/calendar/base/src/calItemBase.js
>--- a/calendar/base/src/calItemBase.js
>+++ b/calendar/base/src/calItemBase.js
>@@ -522,7 +522,7 @@ calItemBase.prototype = {
>     removeAttachment: function cIB_removeAttachment(aAttachment) {
>         this.modify();
>         for (var attIndex in this.mAttachments) {
>-            if (this.mAttachments[attIndex].uri.spec == aAttachment.uri.spec) {
>+            if (cal.compareObjects(mAttachments[attIndex], aAttachment, Components.interfaces.calIAttachment)) {
Do we really want to compare the whole object? I thought maybe the uri should be unique?


>-                ap.data = att.uri.spec;
>+                ap.data = (att.uri ? att.uri.spec : "");
Possibly we want to set null here instead of an empty string? Or does the round trip work out with empty string?

r=philipp with comments considered.
Attachment #371145 - Flags: review?(ssitter) → review+
Assignee: nobody → dbo.moz
AFAIK the uri is optional, so we cannot compare those. Moreover IIRC having multiple identical attachments is valid.
> (From update of attachment 371145 [details] [diff] [review])
> >diff --git a/calendar/base/src/calItemBase.js b/calendar/base/src/calItemBase.js
> >--- a/calendar/base/src/calItemBase.js
> >+++ b/calendar/base/src/calItemBase.js
> >@@ -522,7 +522,7 @@ calItemBase.prototype = {
> >     removeAttachment: function cIB_removeAttachment(aAttachment) {
> >         this.modify();
> >         for (var attIndex in this.mAttachments) {
> >-            if (this.mAttachments[attIndex].uri.spec == aAttachment.uri.spec) {
> >+            if (cal.compareObjects(mAttachments[attIndex], aAttachment, Components.interfaces.calIAttachment)) {
> Do we really want to compare the whole object? I thought maybe the uri should
> be unique?
compareObjects just compare the js references. Since multiple identical attachments may occur, this is the only valid way IMO.


Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/c429f29cf483>

-> FIXED(In reply to comment #6)

This is just a bugfix to import inline attachments gracefully. There's still no overall support for inline attachments.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
OS: Linux → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → 1.0
I am still observing the same problem. So don't think it is fixed
Resolution: FIXED → INVALID
There (In reply to comment #9)
> I am still observing the same problem. So don't think it is fixed

Please leave the resolution as is ('FIXED') or REOPEN the bug report. What version of Lightning did you use to reproduce the original problem?
Resolution: INVALID → FIXED
And how does one REOPEN the bug report? I thought that was what I was doing.

I tested with the 26th April nightly. As per my original report this problem doesn't happen on all VTODOs with similar properties. i.e. many with attachments are handled successfully.
(In reply to comment #11)
> And how does one REOPEN the bug report? I thought that was what I was doing.

Sorry, this feature of Bugzilla has changed recently.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #371145 - Attachment description: graceful import → [checked in] graceful import
Philipp, don't we already have a bug for inline attachment support?

(In reply to comment #9)
> I am still observing the same problem. So don't think it is fixed
still the same error message?
Assignee: dbo.moz → nobody
(In reply to comment #13)
> Philipp, don't we already have a bug for inline attachment support?

This should be bug 168680
(In reply to comment #2)
> Trying to import only the iCalendar part into storage calendar fails with:
> Error: DB error: not an error exc: TypeError: att.uri is null

I can confirm that this import error is gone using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1pre) Gecko/20090703 Calendar/1.0pre.
Reporter (aapthorp), can you please try to reproduce the problem in a recent Lightning 1.0pre nightly build, and report back if this has also been fixed for you?
I've just tested with Mozilla/5.0 (X11; U;Linux i686; en-US; rv:1.9.1.b3pre) Gecko/20090223 Calendar/1.0pre build id 20090710040317 and found an example of when this fails. Admittedly there are some other errors but without the attachment it is parsed successfully and with it fails.

The error only seems to occur in a few special cases now, such as this, but is parsed successfully in 0.9.

This (without attachment) parses successfully:

<D:response>
<D:href>http://LEONARDO:8080/taskcal-dav/manager/calendar/tasks/89776152-f6db-4920-8c16-f4ecb79412b4.ics</D:href>
<D:propstat>
<D:prop>
<D:getetag>"20090704T152434Z-188"</D:getetag>
<C:calendar-data>BEGIN:VCALENDAR
PRODID:-//aapthorp//jBPM iCal wrapper//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VTODO
DTSTAMP:20090711T074942Z
DTSTART:
DUE:
SUMMARY:Create Booking - 188
CREATED:20090704T152434Z
STATUS:NEEDS-ACTION
ATTACH:http://LEONARDO:8080/jbpm-console/sa/task.jsf?id=188
UID:89776152-f6db-4920-8c16-f4ecb79412b4
PRIORITY:3
DESCRIPTION:
CATEGORIES:Create Booking
ORGANIZER:MAILTO:jbpm@noreply
URL:http://LEONARDO:8080/taskcal-dav/manager/calendar/tasks/89776152-f6db-4
 920-8c16-f4ecb79412b4.ics
LAST-MODIFIED:20090704T152434Z
ATTENDEE;CN=manager;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MA
 ILTO:manager@newton.ajita.com
END:VTODO
END:VCALENDAR
</C:calendar-data>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>

This (with attachment) doesn't parse successfully:


Warning: Failed to parse item: <D:response xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <D:href>http://LEONARDO:8080/taskcal-dav/manager/calendar/tasks/89776152-f6db-4920-8c16-f4ecb79412b4.ics</D:href>
  <D:propstat>
    <D:prop>
      <D:getetag>"20090704T152434Z-188"</D:getetag>
      <C:calendar-data>BEGIN:VCALENDAR
PRODID:-//aapthorp//jBPM iCal wrapper//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VTODO
DTSTAMP:20090711T075551Z
DTSTART:
DUE:
SUMMARY:Create Booking - 188
CREATED:20090704T152434Z
STATUS:NEEDS-ACTION
ATTACH:http://LEONARDO:8080/jbpm-console/sa/task.jsf?id=188
UID:89776152-f6db-4920-8c16-f4ecb79412b4
PRIORITY:3
DESCRIPTION:
CATEGORIES:Create Booking
ATTACH;ENCODING=BASE64;VALUE=BINARY;FMTTYPE=text/html:PEhUTUw+DQo8Qk9EWT4NC
 jxQUkUgc3R5bGU9ImZvbnQtZmFtaWx5OiBtb25vc3BhY2U7IGZvbnQtc2l6ZTogMTJweCI+DQo
 8aHRtbDp0YWJsZSBib3JkZXI9IjEiIGNlbGxwYWRkaW5nPSIyIiBjZWxsc3BhY2luZz0iMiIgd
 2lkdGg9IjEwMCUiPjxodG1sOnRib2R5Pg0KPGh0bWw6dHI+DQoJPGh0bWw6dGQgdmFsaWduPSJ
 0b3AiPkM6VUlEPC9odG1sOnRkPg0KCTxodG1sOnRkIHZhbGlnbj0idG9wIj48aHRtbDppbnB1d
 CB0eXBlPSJ0ZXh0IiBuYW1lPSJDOlVJRCIgdmFsdWU9Ijg5Nzc2MTUyLWY2ZGItNDkyMC04YzE
 2LWY0ZWNiNzk0MTJiNCIvPg0KCTxodG1sOmJyIC8+DQoJPC9odG1sOnRkPg0KPC9odG1sOnRyP
 g0KPGh0bWw6dHI+DQoJPGh0bWw6dGQgdmFsaWduPSJ0b3AiPkM6UEFSVFNUQVQ8L2h0bWw6dGQ
 +DQoJPGh0bWw6dGQgdmFsaWduPSJ0b3AiPjxodG1sOmlucHV0IHR5cGU9InRleHQiIG5hbWU9I
 kM6UEFSVFNUQVQiIHZhbHVlPSJORUVEUy1BQ1RJT04iLz4NCgk8aHRtbDpiciAvPg0KCTwvaHR
 tbDp0ZD4NCjwvaHRtbDp0cj4NCjxodG1sOnRyPg0KCTxodG1sOnRkIHZhbGlnbj0idG9wIj5DO
 kRUU1RBUlQ8L2h0bWw6dGQ+DQoJPGh0bWw6dGQgdmFsaWduPSJ0b3AiPjxodG1sOmlucHV0IHR
 5cGU9InRleHQiIG5hbWU9IkM6RFRTVEFSVCIgdmFsdWU9IiR2YXJNYXAuZ2V0KCRrZXkpIi8+D
 QoJPGh0bWw6YnIgLz4NCgk8L2h0bWw6dGQ+DQo8L2h0bWw6dHI+DQo8L2h0bWw6dGJvZHk+PC9
 odG1sOnRhYmxlPg0KPC9QUkU+DQo8L0JPRFk+DQo8L0hUTUw+
ORGANIZER:MAILTO:jbpm@noreply
URL:http://LEONARDO:8080/taskcal-dav/manager/calendar/tasks/89776152-f6db-4
 920-8c16-f4ecb79412b4.ics
LAST-MODIFIED:20090704T152434Z
ATTENDEE;CN=manager;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MA
 ILTO:manager@newton.ajita.com
END:VTODO
END:VCALENDAR</C:calendar-data>
    </D:prop>
    <D:status>HTTP/1.1 200 OK</D:status>
  </D:propstat>
</D:response>
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
Target Milestone: 1.0b1 → ---
Whiteboard: [calconnect31]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: