Couldn't parse iCalendar caused by Unparseable date


  • Hello, got the following exception and could not sync anymore.
    In the ics file the “unparseble date” is present in these two fields:

    LAST-MODIFIED;VALUE=DATE-TIME:20211025T145859Z
    ACKNOWLEDGED::20211025T145859Z

    Other events have dates in similar format.

    Thank for your support

    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.ical4android.Event$Companion.eventsFromReader$default(Event.kt:83)
    at at.bitfire.icsdroid.ProcessEventsTask$processEvents$downloader$1.onSuccess(ProcessEventsTask.kt:62)
    at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:133)
    at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
    at at.bitfire.icsdroid.ProcessEventsTask.processEvents(ProcessEventsTask.kt:101)
    at at.bitfire.icsdroid.ProcessEventsTask.run(ProcessEventsTask.kt:34)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
    Caused by: net.fortuna.ical4j.data.ParserException: Error at line 180:Unparseable date: “:20211025T145859Z”
    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)
    … 10 more
    Caused by: java.text.ParseException: Unparseable date: “:20211025T145859Z”
    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)
    at net.fortuna.ical4j.model.property.DateProperty.setValue(DateProperty.java:138)
    at net.fortuna.ical4j.model.property.Acknowledged.<init>(Acknowledged.java:124)
    at net.fortuna.ical4j.model.property.Acknowledged$Factory.createProperty(Acknowledged.java:158)
    at net.fortuna.ical4j.model.PropertyBuilder.build(PropertyBuilder.java:55)
    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)
    … 13 more

  • developer

    @lguerr Hello,

    ACKNOWLEDGED::20211025T145859Z

    Why are there two ::? According to https://datatracker.ietf.org/doc/html/rfc9074#section-6.1, it should look like this:

    ACKNOWLEDGED:20210302T151514Z

    In your file, there are two :, so the second colon belongs to the date, so the date can’t be parsed.

    So I think this is a problem in your iCalendar file.


  • @rfc2822 yes that was the problem. I noticed that in ics file there are two other fields incorrect related to the same event:

    ACKNOWLEDGED::20211025T145859Z
    UID::0C816698-8EDB-43FF-BEA7-EE673ED0B6A1
    X-WR-ALARMUID::0C816698-8EDB-43FF-BEA7-EE673ED0B6A1

    The strange thing is that these fields are only present in the ics file retrieved by subscription to ical and not in calendar ics itself.
    Deleted the event now is OK.
    Thank you so much for your kind support

  • developer

    @lguerr Where do these subscriptions come from? Can you report this problem to the service provider?

Similar topics