nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
979 stars 241 forks source link

can no longer add subscription from outlook.office365.com / end of document reached prematurely #5620

Closed darmbrust closed 10 months ago

darmbrust commented 10 months ago

Steps to reproduce

Try to sync an outlook calendar - it will not report any errors in the UI - but the log file will report various errors:

Sabre\VObject\EofException: End of document reached prematurely
Sabre\VObject\ParseException: This parser only supports VCARD and VCALENDAR files

This has just broken in the last few days - likely due to some change Microsoft has made.

Here is a sample file generated by Microsoft - which cannot be imported by the next cloud calendar:

BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
X-WR-CALNAME:Calendar
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VTIMEZONE
TZID:Mountain Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VTIMEZONE
TZID:Central Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0600
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0600
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DESCRIPTION:test
RRULE:FREQ=WEEKLY;UNTIL=20240328T173000Z;INTERVAL=1;BYDAY=TH;WKST=SU
EXDATE;TZID=Eastern Standard Time:20231221T133000
UID:040000008200E00074C5B7101A82E008000000001022AAECA7EFD901000000000000000
 010000000347D6B8CF03A684CB33FA315A093BC0D
SUMMARY:test
DTSTART;TZID=Eastern Standard Time:20231005T133000
DTEND;TZID=Eastern Standard Time:20231005T150000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20231211T203146Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:2
LOCATION:Microsoft Teams Meeting
X-MICROSOFT-CDO-APPT-SEQUENCE:2
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:1
END:VEVENT

The file is valid, according to online syntax checkers I've run it against.

Expected behavior

parse and show calendar events

Actual behaviour

fails to parse any items from the shared calendar.

Calendar app version

4.5.2

CalDAV-clients used

No response

Browser

any

Client operating system

linux

Server operating system

No response

Web server

None

Database engine version

None

PHP engine version

None

Nextcloud version

No response

Updated from an older installed version or fresh install

None

List of activated apps

No response

Nextcloud configuration

No response

Web server error log

[dav] Warning: Sabre\VObject\EofException: End of document reached prematurely at <<closure>>

 0. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 205
    Sabre\VObject\Parser\MimeDir->readLine()
 1. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 2. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 3. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 4. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 5. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 6. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 7. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 8. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
 9. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
10. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
11. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
12. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
13. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
14. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
15. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
16. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
17. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
18. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
19. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
20. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
21. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
22. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
23. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
24. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
25. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
26. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 209
    Sabre\VObject\Parser\MimeDir->parseLine()
27. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 174
    Sabre\VObject\Parser\MimeDir->parseLine()
28. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Parser/MimeDir.php line 90
    Sabre\VObject\Parser\MimeDir->parseDocument()
29. /opt/storage/websiteGitCheckout/website/content/nextcloud/3rdparty/sabre/vobject/lib/Reader.php line 47
    Sabre\VObject\Parser\MimeDir->parse()
30. /opt/storage/websiteGitCheckout/website/content/nextcloud/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php line 250
    Sabre\VObject\Reader::read()
31. /opt/storage/websiteGitCheckout/website/content/nextcloud/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php line 89
    OCA\DAV\CalDAV\WebcalCaching\RefreshWebcalService->queryWebcalFeed()
32. /opt/storage/websiteGitCheckout/website/content/nextcloud/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php line 115
    OCA\DAV\CalDAV\WebcalCaching\RefreshWebcalService->refreshSubscription()
33. /opt/storage/websiteGitCheckout/website/content/nextcloud/lib/public/BackgroundJob/Job.php line 78
    OCA\DAV\BackgroundJob\RefreshWebcalJob->run()
34. /opt/storage/websiteGitCheckout/website/content/nextcloud/lib/public/BackgroundJob/Job.php line 64
    OCP\BackgroundJob\Job->start()
35. /opt/storage/websiteGitCheckout/website/content/nextcloud/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php line 108
    OCP\BackgroundJob\Job->execute()
36. /opt/storage/websiteGitCheckout/website/content/nextcloud/cron.php line 152
    OCA\DAV\BackgroundJob\RefreshWebcalJob->execute()

at 2023-12-11T20:25:05+00:00

Log file

No response

Browser log

No response

Additional info

No response

miaulalala commented 10 months ago

Looks like it's missing the END:VCALENDAR? Can you manually add it and try importing the ics?

DANIEL-ARMBRUST-VA commented 10 months ago

So its interesting - indeed, adding the END:VCALENDAR makes this sample valid - I went back to my real calendar and pulled it from the outlook share again - and its also omitting all of the END:VEVENTS, in addition to the END:VCALENDAR.

Outlook must have made a change in their output format... guess the question is, is their change valid, and, can we fix the parser to be smart enough to know the END: tags are optional..... at least in Microsofts world... not sure about in the spec....

DANIEL-ARMBRUST-VA commented 10 months ago

From my brief look at what I think is the correct spec, indeed, those END tags should not be optional... but, the validator at icalendar.org says there is no problem with the end tags being missing...

miaulalala commented 10 months ago

From my brief look at what I think is the correct spec, indeed, those END tags should not be optional... but, the validator at icalendar.org says there is no problem with the end tags being missing...

That is weird, I read the RFCs too and the tags are decidedly not optional...

darmbrust commented 10 months ago

It appears that microsoft has fixed their problem as of this morning - at least for my account.