{"record":{"id":"08845631f707119d","repo":"nextcloud/server","slug":"calendar-does-not-support-vevent-components","errorCode":null,"errorMessage":"Calendar does not support VEVENT components","messagePattern":"Calendar does not support VEVENT components","errorType":"http","errorClass":"DavException","httpStatus":500,"severity":"error","filePath":"apps/dav/lib/CalDAV/DefaultCalendarValidator.php","lineNumber":38,"sourceCode":"\tpublic function validateScheduleDefaultCalendar(Calendar $calendar): void {\n\t\t// Sanity checks for a calendar that should handle invitations\n\t\tif ($calendar->isSubscription()\n\t\t\t|| !$calendar->canWrite()\n\t\t\t|| $calendar->isShared()\n\t\t\t|| $calendar->isDeleted()) {\n\t\t\tthrow new DavException('Calendar is a subscription, not writable, shared or deleted');\n\t\t}\n\n\t\t// Calendar must support VEVENTs\n\t\t$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n\t\t$calendarProperties = $calendar->getProperties([$sCCS]);\n\t\tif (isset($calendarProperties[$sCCS])) {\n\t\t\t$supportedComponents = $calendarProperties[$sCCS]->getValue();\n\t\t} else {\n\t\t\t$supportedComponents = ['VJOURNAL', 'VTODO', 'VEVENT'];\n\t\t}\n\t\tif (!in_array('VEVENT', $supportedComponents, true)) {\n\t\t\tthrow new DavException('Calendar does not support VEVENT components');\n\t\t}\n\t}\n}\n","sourceCodeStart":20,"sourceCodeEnd":42,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/DefaultCalendarValidator.php#L20-L42","documentation":"DavException thrown by DefaultCalendarValidator::validateScheduleDefaultCalendar() when the calendar's CalDAV supported-calendar-component-set property does not include VEVENT. Calendars that only support VTODO or VJOURNAL (task lists, journals) cannot store the VEVENT objects that scheduling requires. If the property is absent entirely, the validator assumes VEVENT/VTODO/VJOURNAL support and passes.","triggerScenarios":"Selecting a task-only or journal-only calendar (supported-calendar-component-set = ['VTODO'] or ['VJOURNAL']) as the default scheduling calendar; creating a calendar with restricted components and then passing it to validateScheduleDefaultCalendar().","commonSituations":"User's only remaining calendar is a task list so scheduling falls back to it; calendar created via clients or provisioning with a limited component set; tests that create VTODO calendars and reuse them for event scheduling.","solutions":["Choose or create a calendar whose component set includes VEVENT before validating.","Recreate the calendar with components ['VEVENT'] (or VEVENT+VTODO) via the CalDAV backend or calendar management API.","In code, read the {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set property first and only validate calendars that contain VEVENT."],"exampleFix":"// before\n$validator->validateScheduleDefaultCalendar($taskCalendar);\n\n// after\n$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n$props = $taskCalendar->getProperties([$sCCS]);\n$supported = isset($props[$sCCS]) ? $props[$sCCS]->getValue() : ['VEVENT'];\nif (!in_array('VEVENT', $supported, true)) {\n\t$taskCalendar = $calendarManager->createCalendar($userId, 'events', ['VEVENT']);\n}\n$validator->validateScheduleDefaultCalendar($taskCalendar);","handlingStrategy":"validation","validationCode":"$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n$props = $calendar->getProperties([$sCCS]);\n$supported = isset($props[$sCCS]) ? $props[$sCCS]->getValue() : ['VEVENT'];\nif (!in_array('VEVENT', $supported, true)) {\n    $calendar = $calendarManager->createCalendar($userId, 'events', ['VEVENT']);\n}\n$validator->validateScheduleDefaultCalendar($calendar);","typeGuard":null,"tryCatchPattern":"try {\n    $validator->validateScheduleDefaultCalendar($calendar);\n} catch (\\OCA\\DAV\\Connector\\Sabre\\Exception\\DavException $e) {\n    // message tells whether it was the state check or the VEVENT check; switch calendar accordingly\n}","preventionTips":["Create scheduling calendars with ['VEVENT'] in the component set.","Do not reuse task (VTODO) or journal calendars for event scheduling.","Cache the component-set check when iterating many candidate calendars."],"tags":["caldav","calendar","vevent","validation","component-set","vtodo"],"backgroundTag":"unsupported-calendar-component","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}