Can’t Add Second iCloud Calendar — ParseException: Invalid Mimedir File

The Basics

Nextcloud Server version:
31.0.6.2 (AIO)

Operating system and version:
Ubuntu 24.04.2 LTS (Noble Numbat)

Web server and version:
AIO - everything up to date

Reverse proxy and version:
Using Cloudflare

PHP version:
PHP 8.3.22

Installation method:
Nextcloud AIO (Docker)

Are you using Cloudflare, mod_security, or similar?
Yes — Cloudflare proxy in front.


Summary of the issue you are facing

I am trying to add multiple calendars from iCloud into the Nextcloud Calendar app.

  • Adding one iCloud calendar works fine (subscription is created and syncs normally).
  • Adding a second iCloud calendar does not work — Nextcloud does not show any error in the UI, but in the logs I get:
ParseException
Invalid Mimedir file. Line starting at 4747 did not follow iCalendar/vCard conventions
Subscription 17 could not be parsed

How I try to add it:

  1. Open the Calendar app
  2. Click +New subscription from link
  3. Paste the iCloud calendar public link
  4. Click Save → nothing happens, no calendar appears.

The iCloud link is a standard published ICS URL. Example (anonymized):

webcal://p108-caldav.icloud.com/published/2/MTM0NjkxNTkxMTEzNDY5M*** (anonymized)

The ICS file can be opened manually (e.g., in Thunderbird, macOS Calendar) without any problems — it is valid and contains events.


Steps to replicate it

  1. Open Calendar app in Nextcloud
  2. Click +New subscription from link
  3. Paste a public iCloud .ics subscription URL
  4. Click Save
  5. Calendar does not appear — log shows the ParseException.

Log entries

ParseException
Invalid Mimedir file. Line starting at 4747 did not follow iCalendar/vCard conventions
Subscription 17 could not be parsed

Web browser console

No relevant errors in the browser inspector — the subscription simply does not get created.


Web server / reverse proxy

Nextcloud AIO behind Cloudflare proxy — no additional reverse proxy in between.


Configuration

Output from occ config:list system:

{
  "system": {
    ...
    "version": "31.0.6.2",
    "overwrite.cli.url": "https://mydomain.example.com/",
    "trusted_domains": [
      "localhost",
      "mydomain.example.com"
    ],
    ...
  }
}

Apps

Enabled:
  - calendar: 5.3.4
  - dav: 1.33.0
  - (others – see above)

Disabled:
  - files_external: 1.23.0
  - (others – see above)

Thank you so much for any hints or help! :folded_hands:

I really appreciate your time and the community support :heart:

1 Like

This looks like a known issue with some iCloud calendars producing ICS files that include non-standard formatting or long lines breaking iCalendar specs. While Thunderbird/macOS may handle these leniently, Nextcloud’s parser is stricter. You can try importing the ICS file manually (download and upload), or preprocess it through a validator like icalvalid.cloud to spot the issue. For a more robust fix, consider opening a GitHub issue with the problematic ICS file (sanitized) so the devs can improve compatibility.

@hackito Thanks a lot for your reply!

I already checked for invalid events (specifically location fields). I actually found quite a few problematic entries (mostly in the location fields). I also reported this as a bug on GitHub, but so far there hasn’t been any reaction.

I’m still trying to figure out any possible workaround, but haven’t found one yet. I even tried aggregating the iCloud calendar through Google Calendar, but that just passes the same non-standard formatting to Nextcloud, so the issue stays the same.

Do you have any other ideas for a workaround?

The main thing I need is to subscribe to my iCloud calendar in Nextcloud - just to see my availability in the Appointments app. I don’t need to see the iCloud calendar data (location etc.) in Nextcloud permanently. I only need to see when I’m free or busy.

Also, could you clarify what you meant by icalvalid.cloud? I couldn’t find it — is there a link or tool you could share?

Thanks again for your help. I really appreciate it!

You are referring to ParseException: Invalid Mimedir file when subscribing to iCloud calendar · Issue #7082 · nextcloud/calendar · GitHub?