{"record":{"id":"0e8fc9a221597c05","repo":"nextcloud/server","slug":"calendar-calendarid-doesn-t-support-this-functi","errorCode":null,"errorMessage":"Calendar <$calendarId> doesn't support this function","messagePattern":"Calendar <\\$calendarId> doesn't support this function","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"warning","filePath":"apps/dav/lib/Command/ImportCalendar.php","lineNumber":89,"sourceCode":"\t\t$errors = is_numeric($input->getOption('errors')) ? (int)$input->getOption('errors') : null;\n\t\t$validation = is_numeric($input->getOption('validation')) ? (int)$input->getOption('validation') : null;\n\t\t$supersede = $input->getOption('supersede');\n\t\t$showCreated = $input->getOption('show-created');\n\t\t$showUpdated = $input->getOption('show-updated');\n\t\t$showSkipped = $input->getOption('show-skipped');\n\t\t$showErrors = $input->getOption('show-errors');\n\n\t\tif (!$this->userManager->userExists($userId)) {\n\t\t\tthrow new InvalidArgumentException(\"User <$userId> not found.\");\n\t\t}\n\t\t// retrieve calendar and evaluate if import is supported and writeable\n\t\t$calendars = $this->calendarManager->getCalendarsForPrincipal('principals/users/' . $userId, [$calendarId]);\n\t\tif ($calendars === []) {\n\t\t\tthrow new InvalidArgumentException(\"Calendar <$calendarId> not found\");\n\t\t}\n\t\t$calendar = $calendars[0];\n\t\tif (!$calendar instanceof CalendarImpl) {\n\t\t\tthrow new InvalidArgumentException(\"Calendar <$calendarId> doesn't support this function\");\n\t\t}\n\t\tif (!$calendar->isWritable()) {\n\t\t\tthrow new InvalidArgumentException(\"Calendar <$calendarId> is not writeable\");\n\t\t}\n\t\tif ($calendar->isDeleted()) {\n\t\t\tthrow new InvalidArgumentException(\"Calendar <$calendarId> is deleted\");\n\t\t}\n\t\t// construct options object\n\t\t$options = new CalendarImportOptions();\n\t\t$options->setSupersede($supersede);\n\t\tif ($errors !== null) {\n\t\t\t$options->setErrors($errors);\n\t\t}\n\t\tif ($validation !== null) {\n\t\t\t$options->setValidate($validation);\n\t\t}\n\t\t$options->setFormat($format);\n\t\t$options->setCounts(true);","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/ImportCalendar.php#L71-L107","documentation":"InvalidArgumentException thrown by occ dav:import-calendar (apps/dav/lib/Command/ImportCalendar.php:89) when the resolved calendar is not an OCA\\DAV\\CalDAV\\CalendarImpl - i.e. it is a calendar contributed by an app through the calendar plugin/registry rather than a database-backed CalDAV calendar. Bulk import writes objects straight into the CalDAV backend, which only works for real CalDAV calendars.","triggerScenarios":"occ dav:import-calendar alice <uri> ... where <uri> resolves to an ICalendar provided by an app (external/plugin calendar), not to CalendarImpl.","commonSituations":"Trying to import into read-only app calendars (e.g. birthday or app-generated calendars); custom apps registering ICalendar implementations expecting them to be importable.","solutions":["Import into a regular CalDAV calendar (one the user can edit in the Calendar app)","Create a fresh calendar as import target if needed","For app calendars, use the app's own import path"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"$calendars = $calendarManager->getCalendarsForPrincipal('principals/users/' . $uid, [$uri]);\nif (!$calendars[0] instanceof \\OCA\\DAV\\CalDAV\\CalendarImpl) {\n    throw new RuntimeException('Target is not an importable CalDAV calendar');\n}","typeGuard":"$isImportable = fn ($c): bool => $c instanceof \\OCA\\DAV\\CalDAV\\CalendarImpl;","tryCatchPattern":null,"preventionTips":["Only CalDAV-backed calendars accept bulk import","App calendars expose data read-only; use their own import tooling","Check the calendar source before scripting imports"],"tags":["occ","cli","import","calendar","caldav","unsupported-operation","plugin-calendar"],"backgroundTag":"unsupported-operation","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}