{"record":{"id":"f4ec89db3cc78089","repo":"nextcloud/server","slug":"could-not-write-to-calendar-as-uri-parameter-is-mi","errorCode":null,"errorMessage":"Could not write to calendar as URI parameter is missing","messagePattern":"Could not write to calendar as URI parameter is missing","errorType":"exception","errorClass":"CalendarException","httpStatus":500,"severity":"error","filePath":"apps/dav/lib/CalDAV/CalendarImpl.php","lineNumber":205,"sourceCode":"\t}\n\n\t/**\n\t * @throws CalendarException\n\t */\n\tprivate function createFromStringInServer(\n\t\tstring $name,\n\t\tstring $calendarData,\n\t\tServer $server,\n\t): void {\n\t\t/** @var CustomPrincipalPlugin $plugin */\n\t\t$plugin = $server->getPlugin('auth');\n\t\t// we're working around the previous implementation\n\t\t// that only allowed the public system principal to be used\n\t\t// so set the custom principal here\n\t\t$plugin->setCurrentPrincipal($this->calendar->getPrincipalURI());\n\n\t\tif (empty($this->calendarInfo['uri'])) {\n\t\t\tthrow new CalendarException('Could not write to calendar as URI parameter is missing');\n\t\t}\n\n\t\t// Build full calendar path\n\t\t[, $user] = uriSplit($this->calendar->getPrincipalURI());\n\t\t$fullCalendarFilename = sprintf('calendars/%s/%s/%s', $user, $this->calendarInfo['uri'], $name);\n\n\t\t// Force calendar change URI\n\t\t/** @var Schedule\\Plugin $schedulingPlugin */\n\t\t$schedulingPlugin = $server->getPlugin('caldav-schedule');\n\t\t$schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename);\n\n\t\t$stream = fopen('php://memory', 'rb+');\n\t\tfwrite($stream, $calendarData);\n\t\trewind($stream);\n\t\ttry {\n\t\t\t$server->createFile($fullCalendarFilename, $stream);\n\t\t} catch (Conflict $e) {\n\t\t\tthrow new CalendarException('Could not create new calendar event: ' . $e->getMessage(), 0, $e);","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/CalendarImpl.php#L187-L223","documentation":"Error \"Could not write to calendar as URI parameter is missing\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/CalDAV/CalendarImpl.php:205 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"}