{"record":{"id":"874c52c68dcc1609","repo":"nextcloud/server","slug":"uri-too-long-calendar-not-created","errorCode":null,"errorMessage":"URI too long. Calendar not created","messagePattern":"URI too long\\. Calendar not created","errorType":"exception","errorClass":"OCP\\Calendar\\Exceptions\\CalendarException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/CalDAV/CalDavBackend.php","lineNumber":819,"sourceCode":"\t}\n\n\t/**\n\t * Creates a new calendar for a principal.\n\t *\n\t * If the creation was a success, an id must be returned that can be used to reference\n\t * this calendar in other methods, such as updateCalendar.\n\t *\n\t * @param string $principalUri\n\t * @param string $calendarUri\n\t * @param array $properties\n\t * @return int\n\t *\n\t * @throws CalendarException\n\t */\n\t#[\\Override]\n\tpublic function createCalendar($principalUri, $calendarUri, array $properties) {\n\t\tif (strlen($calendarUri) > 255) {\n\t\t\tthrow new CalendarException('URI too long. Calendar not created');\n\t\t}\n\n\t\t$values = [\n\t\t\t'principaluri' => $this->convertPrincipal($principalUri, true),\n\t\t\t'uri' => $calendarUri,\n\t\t\t'synctoken' => 1,\n\t\t\t'transparent' => 0,\n\t\t\t'components' => 'VEVENT,VTODO,VJOURNAL',\n\t\t\t'displayname' => $calendarUri\n\t\t];\n\n\t\t// Default value\n\t\t$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n\t\tif (isset($properties[$sccs])) {\n\t\t\tif (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) {\n\t\t\t\tthrow new DAV\\Exception('The ' . $sccs . ' property must be of type: \\Sabre\\CalDAV\\Property\\SupportedCalendarComponentSet');\n\t\t\t}\n\t\t\t$values['components'] = implode(',', $properties[$sccs]->getValue());","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/CalDavBackend.php#L801-L837","documentation":"Error \"URI too long. Calendar not created\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/CalDAV/CalDavBackend.php:819 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}