Closed Bug 1737067 Opened 3 years ago Closed 3 years ago

lightning failed to parse item it just saved in caldav

Categories

(Calendar :: Provider: CalDAV, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: gaston, Unassigned)

Details

(Whiteboard: [gnustep-base 1.28])

since a while, ive been having issues with lightning failing to display events it just created in the remote caldav server (in my case, sogo 5.2.0 running on OpenBSD 7.0, previously sogo 5.0.1 running on OpenBSD 6.9) - that's with thunderbird 91.2.0 right now, but i've been experiencing this issue since a while testing previous betas, and my colleagues on windows with 78.14.0 also experiences it.

lightning sends the ICS object to the server, it's properly saved remotely (eg i can fetch it via cadaver/caldav):

dav:/SOGo/dav/breuil/Calendar/personal/> cat bb6f040f-7979-4ca9-90c8-37fd037944d7.ics
Displaying `/SOGo/dav/breuil/Calendar/personal/bb6f040f-7979-4ca9-90c8-37fd037944d7.ics':
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20211021T141143Z
LAST-MODIFIED:20211021T141219Z
DTSTAMP:20211021T141219Z
UID:bb6f040f-7979-4ca9-90c8-37fd037944d7
SUMMARY:TT?
DTSTART;VALUE=DATE:20211117
DTEND;VALUE=DATE:20211118
TRANSP:TRANSPARENT
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

the event is shown in sogo's web calendar.

but it wont display in lightning, and the error console has this to say (all those msgs for a single event saved once):

Calendar: Parser Error. Could not find 'VCALENDAR' component.
BEGIN:VEVENT
CREATED:20211021T141143Z
LAST-MODIFIED:20211021T141219Z
DTSTAMP:20211021T141219Z
UID:bb6f040f-7979-4ca9-90c8-37fd037944d7
SUMMARY:TT?
DTSTART;VALUE=DATE:20211117
DTEND;VALUE=DATE:20211118
TRANSP:TRANSPARENT
CLASS:PUBLIC
END:VEVENT
1: [resource:///modules/CalIcsParser.jsm:48] processIcalComponent
2: [resource:///modules/CalIcsParser.jsm:165] parseString
3: [resource:///modules/CalDavCalendar.jsm:920] addTargetCalendarItem
4: [resource:///modules/caldav/CalDavRequestHandlers.jsm:985] endElement
5: [resource:///modules/caldav/CalDavRequestHandlers.jsm:113] _walk
CalIcsParser.jsm:48
Calendar: Failed to parse item: BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20211021T141143Z
LAST-MODIFIED:20211021T141219Z
DTSTAMP:20211021T141219Z
UID:bb6f040f-7979-4ca9-90c8-37fd037944d7
SUMMARY:TT?
DTSTART;VALUE=DATE:20211117
DTEND;VALUE=DATE:20211118
TRANSP:TRANSPARENT
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR CalDavCalendar.jsm:943
Calendar: Parser Error. Could not find 'VCALENDAR' component.
BEGIN:VEVENT
CREATED:20211021T141143Z
LAST-MODIFIED:20211021T141219Z
DTSTAMP:20211021T141219Z
UID:bb6f040f-7979-4ca9-90c8-37fd037944d7
SUMMARY:TT?
DTSTART;VALUE=DATE:20211117
DTEND;VALUE=DATE:20211118
TRANSP:TRANSPARENT
CLASS:PUBLIC
END:VEVENT
1: [resource:///modules/CalIcsParser.jsm:48] processIcalComponent
2: [resource:///modules/CalIcsParser.jsm:165] parseString
3: [resource:///modules/CalDavCalendar.jsm:920] addTargetCalendarItem
4: [resource:///modules/caldav/CalDavRequestHandlers.jsm:985] endElement
5: [resource:///modules/caldav/CalDavRequestHandlers.jsm:113] _walk
CalIcsParser.jsm:48
Calendar: Failed to parse item: BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20211021T141143Z
LAST-MODIFIED:20211021T141219Z
DTSTAMP:20211021T141219Z
UID:bb6f040f-7979-4ca9-90c8-37fd037944d7
SUMMARY:TT?
DTSTART;VALUE=DATE:20211117
DTEND;VALUE=DATE:20211118
TRANSP:TRANSPARENT
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR CalDavCalendar.jsm:943
[Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIPrefBranch.getComplexValue]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: chrome://messenger/content/aboutDialog.js :: init :: line 31"  data: no]

it's as if the ical parser was discarding/losing bits of the ICS ?

as a test, i've tried toggling calendar.icaljs to true, and lightning chokes on the same events:

Ical.jsm:1978:9 TypeError: state.designSet is undefined 
 CalIcsParser.jsm:167 Calendar: [JavaScript Error: "state.designSet is undefined" {file: "resource:///modules/calendar/Ical.jsm" line: 1978}]'[JavaScript Error: "state.designSet is undefined" {file: "resource:///modules/calendar/Ical.jsm" line: 1978}]' when calling method: [calIICSService::parseICS] when parsing
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20211018T073221Z
LAST-MODIFIED:20211022T122907Z
DTSTAMP:20211022T122907Z
UID:61520901-9334-43c1-b413-0eecce8df8b4
SUMMARY:cp
DTSTART;VALUE=DATE:20211029
DTEND;VALUE=DATE:20211030
CLASS:PUBLIC
TRANSP:TRANSPARENT
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR

CalDavCalendar.jsm:943 Calendar: Failed to parse item: BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20211018T073221Z
LAST-MODIFIED:20211022T122907Z
DTSTAMP:20211022T122907Z
UID:61520901-9334-43c1-b413-0eecce8df8b4
SUMMARY:cp
DTSTART;VALUE=DATE:20211029
DTEND;VALUE=DATE:20211030
CLASS:PUBLIC
TRANSP:TRANSPARENT
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR

trying to figure out if it can be something wrong serverside within sogo, but since it seems to send valid ICS to lightning...

Fwiw, i reproduce the issue trying to load the same calendar in a new profile with thunderbird 78.8.1 on ubuntu 20.04 against the same sogo 5.2.0 server. i've tried downgrading sogo to 5.0.1, and this didnt help. Will dig further.

another thing that i dont understand is that the debug/error msgs seems to say that the same ICS content is within VCALENDAR tags sometimes, or within XROOT tags, which seems weird. Is the XROOT tag something added on the fly by lightning, replacing VCALENDAR tags depending on some headers ? Is there a way to dump the content received on the wire by lightning ?

looking with tcpdump/wireshark, it seems the <calendar-data> content starts with an utf-8 BOM (or thats added/displayed by wireshark?) and im not sure that's expected ?

<C:calendar-data>
     [truncated]&#65279;BEGIN:VCALENDAR\nPRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN\nVERSION:2.0\nBEGIN:VTIMEZONE\nTZID:Europe/Paris\nBEGIN:DAYLIGHT\nTZOFFSETFROM:+0100\nTZOFFSETTO:+0200\nTZNAME:CEST\nDTSTART:19700329T020000\nRRU
    </C:calendar-data>

manually fetching an ICS entry via cadaver/webdav doesnt show this UTF-8 BOM in the saved ics file, and the tcpdump session was between the sogo server and the nginx frontend. So i'd love to find a way to dump the received bytes by lightning..

from the same thunderbird instance i'm able to save events in a remote davical 1.1.10 (and they're properly fetched/displayed back), so i think something is wrong with sogo somewhere.

after hours of debugging and bisecting, i think i've found out where the &#65279; char comes from: regression from updating gnustep-base 1.27 to 1.28, so it's definitely not a thunderbird bug. after reverting the gnustep-base update, i'm able to see saved events in thunderbird.

For reference: https://www.sogo.nu/bugs/view.php?id=5416 & https://github.com/gnustep/libs-base/issues/212

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
Whiteboard: [gnustep-base 1.28]
You need to log in before you can comment on or make changes to this bug.