NullPointerException for net.fortuna.ical4j.model.TimeZone when importing ics into Team Calendars

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

Summary

When attempting to import an ics/ical calendar into Team Calendars, import is failing with the following warning:

The uploaded data does not seem to be iCalendar content


Diagnosis

For Server and Data Center only

  1. Enable DEBUG logging for com.atlassian.confluence.extra.calendar3 class (see Configuring Logging for instructions on how to do that)
  2. After Debug logging is enabled, attempt to import calendar again and search atlassian-confluence.log for the following exception

DEBUG [http-nio-27130-exec-4] [extra.calendar3.xwork.ImportSubCalendarAction] validate Unable to read uploaded file as iCalendar
 -- referer: http://localhost:27130/calendar/mycalendar.action | url: /plugins/calendar/importsubcalendar.action | traceId: edfcd1c6d19787fd | userName: admin | action: importsubcalendar
net.fortuna.ical4j.data.ParserException: Error at line 147:null
	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:162)
~~~~~~~~~~~~~~~~~~~~~~
Caused by: java.lang.NullPointerException
	at net.fortuna.ical4j.model.TimeZone.<init>(TimeZone.java:70)
	at net.fortuna.ical4j.data.DefaultContentHandler.endComponent(DefaultContentHandler.java:123)

Fist part of the exception will specify which line the error occurring at (Error at line 147:null), which should be END:VTIMEZONE

Second part of exception indicates that there is a Time Zone parameter missing.

It does not mean that specific line in question has the problem, but rather that the section the line is ending at.


(warning) If your Caused by exception is different, you most likely are not affected by the problem described in this KB.

There are a few known bugs that will show The uploaded data does not seem to be iCalendar content error too:

(info) This error will also show up in case of any formatting issue with ical that prevent correct file parsing by the Team Calendars app.

Cause

If you are observing the same exception as documented in Diagnosis section, then it could be that Time Zone ID (TZID) value is missing or incorrect between VTIMEZONE parameters:

BEGIN:VTIMEZONE
~~~~~~~~~~~
END:VTIMEZONE

As a result, Team Calendars fails to read the whole time zone section and import the calendar.

Solution

Edit the *.ics file you are attempting to import and add missing TZID parameter after BEGIN:VTIMEZONE. ((info) You can use the time zone most commonly used in the calendar within DTSTART parameters)

BEGIN:VTIMEZONE
TZID:Europe/Madrid
~~~~~~~~~~~
END:VTIMEZONE

Save and attempt calendar import again.

(info) Removing entire VTIMEZONE section will also allow calendar import, but Time Zone parameters can be critical if calendar contains events generated in multiple time zones.


Last modified on Jan 28, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.