nextcloud/server · error · CalendarException

Could not write to calendar as URI parameter is missing

Error message

Could not write to calendar as URI parameter is missing

What it means

Error "Could not write to calendar as URI parameter is missing" thrown in nextcloud/server.

Source

Thrown at apps/dav/lib/CalDAV/CalendarImpl.php:205

	}

	/**
	 * @throws CalendarException
	 */
	private function createFromStringInServer(
		string $name,
		string $calendarData,
		Server $server,
	): void {
		/** @var CustomPrincipalPlugin $plugin */
		$plugin = $server->getPlugin('auth');
		// we're working around the previous implementation
		// that only allowed the public system principal to be used
		// so set the custom principal here
		$plugin->setCurrentPrincipal($this->calendar->getPrincipalURI());

		if (empty($this->calendarInfo['uri'])) {
			throw new CalendarException('Could not write to calendar as URI parameter is missing');
		}

		// Build full calendar path
		[, $user] = uriSplit($this->calendar->getPrincipalURI());
		$fullCalendarFilename = sprintf('calendars/%s/%s/%s', $user, $this->calendarInfo['uri'], $name);

		// Force calendar change URI
		/** @var Schedule\Plugin $schedulingPlugin */
		$schedulingPlugin = $server->getPlugin('caldav-schedule');
		$schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename);

		$stream = fopen('php://memory', 'rb+');
		fwrite($stream, $calendarData);
		rewind($stream);
		try {
			$server->createFile($fullCalendarFilename, $stream);
		} catch (Conflict $e) {
			throw new CalendarException('Could not create new calendar event: ' . $e->getMessage(), 0, $e);

View on GitHub (pinned to ecdeb153ff)

When it happens

Trigger: Thrown at apps/dav/lib/CalDAV/CalendarImpl.php:205 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17). Data as JSON: /api/errors/f4ec89db3cc78089. Report an issue: GitHub.