Couldn't parse iCalendar (ICSx Version 1.9.1)


  • Since some month I get “Couldn’t parse iCalendar” with the newest ICSx Version 1.9.1

    ICS-Link: [https://lfv.sybos.net/sybServices/webcal/index.php?token=59f08266f06c1](link url)

    I tested this link in other apps (Outlook, Thunderbird, CalenGoo, throught Google-Calender, IOS native,…), there it works.

    attached the error message:

    Couldn't parse iCalendar
    
    at.bitfire.ical4android.InvalidCalendarException: Couldn't parse iCalendar
    at at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:84)
    at at.bitfire.ical4android.Event$Companion.eventsFromReader(Event.kt:82)
    at at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel$initialize$downloader$1.onSuccess(AddCalendarValidationFragment.kt:114)
    at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:133)
    at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
    at java.lang.Thread.run(Thread.java:923)
    Caused by: net.fortuna.ical4j.data.ParserException: Error at line 46:Text cannot be parsed to a Duration
    at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:162)
    at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:183)
    at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:171)
    at at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:82)
    ... 5 more
    Caused by: j$.time.format.c: Text cannot be parsed to a Duration
    at j$.time.Duration.parse(:4)
    at net.fortuna.ical4j.model.TemporalAmountAdapter.parse(TemporalAmountAdapter.java:137)
    at net.fortuna.ical4j.model.property.Trigger.setValue(Trigger.java:270)
    at net.fortuna.ical4j.model.property.Trigger.<init>(Trigger.java:165)
    at net.fortuna.ical4j.model.property.Trigger$Factory.createProperty(Trigger.java:315)
    at net.fortuna.ical4j.model.PropertyBuilder.build(PropertyBuilder.java:48)
    at net.fortuna.ical4j.data.DefaultContentHandler.endProperty(DefaultContentHandler.java:142)
    at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.parse(CalendarParserImpl.java:298)
    at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.access$1100(CalendarParserImpl.java:230)
    at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:216)
    at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:435)
    at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:411)
    at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:214)
    at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:435)
    at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:411)
    at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:214)
    at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:118)
    at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:184)
    at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:153)
    ... 8 more
    
    
  • developer

    @morphil Hello,

    I have tried with the given URL and I get another error:

    Caused by: net.fortuna.ical4j.data.ParserException: Error at line 1 787:Unparseable date: “Z”

    Caused by: java.text.ParseException: Unparseable date: “Z”
    at java.text.DateFormat.parse(DateFormat.java:362)
    at net.fortuna.ical4j.model.DateTime.setTime(DateTime.java:418)
    at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:349)

    The lines 1787 and following are:

    CREATED:Z
    DTSTAMP:Z
    LAST-MODIFIED:Z

    These values can’t be parsed. LAST-MODIFIED is used to know whether the event has to be updated when ICSx⁵ fetches it again.

    You can use this iCalendar validator: http://ical-validator.herokuapp.com/validate/ to see the error.

    Please contact the generator of the iCalendar file to fix this.


  • Thanks for the fast reply. Now it functions, in this spezial entry (line 1787) the timestamp was not set in the database. Also the link ist very useful.

    But I had a second problem, where there is the same error message, but I don’t find a false entry and all timestamps seems to be right.

    Perhaps you can help me one’s more please, even I think the problem is not ICSx internal: [https://lfv.sybos.net/sybServices/webcal/index.php?token=59cba24f5021c](link url)


  • And now all of a sudden it’s happening to me on all of my ROMs & devices. Calendars from webcal.guru (formerly webcal.fi). Most recent good sync was May 23. Now all fail.

    Using these URLs:
    U.S. Holidays - http://www.webcal.guru/en-US/download_calendar?calendar_instance_id=41

    Good to Know - http://www.webcal.guru/en-US/download_calendar?calendar_instance_id=169

    Couldn't parse iCalendar
    
    at.bitfire.ical4android.InvalidCalendarException: Couldn't parse iCalendar
    	at at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:84)
    	at at.bitfire.ical4android.Event$Companion.eventsFromReader(Event.kt:84)
    	at at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel$initialize$downloader$1.onSuccess(AddCalendarValidationFragment.kt:114)
    	at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:133)
    	at at.bitfire.icsdroid.CalendarFetcher.onRedirect(CalendarFetcher.kt:79)
    	at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:147)
    	at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
    	at java.lang.Thread.run(Thread.java:764)
    Caused by: net.fortuna.ical4j.data.ParserException: Error at line 2,344:Expected [58], read [61]
    	at net.fortuna.ical4j.data.CalendarParserImpl.assertToken(CalendarParserImpl.java:475)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:107)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:184)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:153)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:183)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:171)
    	at at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:82)
    	... 7 more
    
    

    Not sure what’s going on but problem is not with ICSx I don’t think.

    The link validator shows the following:

    
    
        javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
        java.lang.NullPointerException
    
    
    

    EDIT: Forgot to mention. ICSx v1.9.1 and 1.9.2.
    Also used https as well (which I normally do anyway). No difference.


  • So, as a test I uninstalled v1.9.x and installed 1.8.9. It also fails to parse the calendars. Error output is sparse so not as useful as with 1.9.x.
    For me at least it seems that webcal.guru has changed something?

    05-24 17:31:55.952 I/icsx5   (26435): Validating Webcal feed http://www.webcal.guru/en-US/download_calendar?calendar_instance_id=41 (authentication: null)
    05-24 17:31:57.543 V/icsx5   (26435): Get redirect 301 to https://www.webcal.guru/en-US/download_calendar?calendar_instance_id=41
    05-24 17:31:59.395 E/icsx5   (26435): Couldn't validate calendar: at.bitfire.ical4android.InvalidCalendarException: Couldn't parse iCalendar
    
    
  • developer

    This post is deleted!

  • The rare time when I go into panic mode instead of just waiting it out. Problem for me was definitely webcal.guru. Temporary glitch I guess. Syncing on all devices is now good to go.


  • We export ics links from a system in which everyone can define the reminder time themselves.
    Our problem was that if they choose none this was set to PT0 without the duration m.
    If TRIGGER:-PT0, ICSx⁵ aborts with “Couldn’t parse iCalendar”, with TRIGGER:-PT0M it works.

    False:
    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:-PT0
    DESCRIPTION:Reminder: Test
    END:VALARM

    right
    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:-PT0M
    DESCRIPTION:Reminder: Test
    END:VALARM

  • developer

    @morphil Thanks for the update! Yes, the M is mandatory.

Similar topics

  • 1
  • 6
  • 6