nextcloud/server · error · DavException
Calendar does not support VEVENT components
Error message
Calendar does not support VEVENT components
What it means
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.
Source
Thrown at apps/dav/lib/CalDAV/DefaultCalendarValidator.php:38
public function validateScheduleDefaultCalendar(Calendar $calendar): void {
// Sanity checks for a calendar that should handle invitations
if ($calendar->isSubscription()
|| !$calendar->canWrite()
|| $calendar->isShared()
|| $calendar->isDeleted()) {
throw new DavException('Calendar is a subscription, not writable, shared or deleted');
}
// Calendar must support VEVENTs
$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
$calendarProperties = $calendar->getProperties([$sCCS]);
if (isset($calendarProperties[$sCCS])) {
$supportedComponents = $calendarProperties[$sCCS]->getValue();
} else {
$supportedComponents = ['VJOURNAL', 'VTODO', 'VEVENT'];
}
if (!in_array('VEVENT', $supportedComponents, true)) {
throw new DavException('Calendar does not support VEVENT components');
}
}
}
View on GitHub (pinned to ecdeb153ff)
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.
Example fix
// before
$validator->validateScheduleDefaultCalendar($taskCalendar);
// after
$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
$props = $taskCalendar->getProperties([$sCCS]);
$supported = isset($props[$sCCS]) ? $props[$sCCS]->getValue() : ['VEVENT'];
if (!in_array('VEVENT', $supported, true)) {
$taskCalendar = $calendarManager->createCalendar($userId, 'events', ['VEVENT']);
}
$validator->validateScheduleDefaultCalendar($taskCalendar); Defensive patterns
Strategy: validation
Validate before calling
$sCCS = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
$props = $calendar->getProperties([$sCCS]);
$supported = isset($props[$sCCS]) ? $props[$sCCS]->getValue() : ['VEVENT'];
if (!in_array('VEVENT', $supported, true)) {
$calendar = $calendarManager->createCalendar($userId, 'events', ['VEVENT']);
}
$validator->validateScheduleDefaultCalendar($calendar); Try / catch
try {
$validator->validateScheduleDefaultCalendar($calendar);
} catch (\OCA\DAV\Connector\Sabre\Exception\DavException $e) {
// message tells whether it was the state check or the VEVENT check; switch calendar accordingly
} Prevention
- 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.
When it happens
Trigger: 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().
Common situations: 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.
Related errors
- Calendar is a subscription, not writable, shared or deleted
- Could not create new calendar event: {message}
- Parameters missing in order to complete the request. Missing
- Parameters missing in order to complete the request. Missing
- Parameters missing in order to complete the request. Missing
AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17).
Data as JSON: /api/errors/08845631f707119d.
Report an issue: GitHub.