{"record":{"id":"c6d66d2372bf3ca2","repo":"nextcloud/server","slug":"parameters-missing-in-order-to-complete-the-reques-c6d66d","errorCode":null,"errorMessage":"Parameters missing in order to complete the request. Missing Parameters: calendarUrl","messagePattern":"Parameters missing in order to complete the request\\. Missing Parameters: calendarUrl","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apps/dav/lib/CalDAV/Federation/CalendarFederationProvider.php","lineNumber":212,"sourceCode":"\tpublic function getSupportedShareTypes(): array {\n\t\treturn [self::USER_SHARE_TYPE];\n\t}\n\n\t/**\n\t * @throws BadRequestException If notification props are missing.\n\t * @throws ShareNotFound If the notification is not related to a known share.\n\t */\n\tprivate function handleSyncCalendarNotification(array $notification): array {\n\t\t$sharedSecret = $notification['sharedSecret'];\n\t\t$shareWithRaw = $notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH] ?? null;\n\t\t$calendarUrl = $notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL] ?? null;\n\n\t\tif ($shareWithRaw === null || $shareWithRaw === '') {\n\t\t\tthrow new BadRequestException([CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH]);\n\t\t}\n\n\t\tif ($calendarUrl === null || $calendarUrl === '') {\n\t\t\tthrow new BadRequestException([CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL]);\n\t\t}\n\n\t\ttry {\n\t\t\t$shareWith = $this->cloudIdManager->resolveCloudId($shareWithRaw);\n\t\t} catch (\\InvalidArgumentException $e) {\n\t\t\tthrow new ShareNotFound('Invalid sharee cloud id');\n\t\t}\n\n\t\t$calendars = $this->federatedCalendarMapper->findByRemoteUrl(\n\t\t\t$calendarUrl,\n\t\t\t'principals/users/' . $shareWith->getUser(),\n\t\t\t$sharedSecret,\n\t\t\tFederatedCalendarEntity::STATE_ACCEPTED,\n\t\t);\n\t\tif (empty($calendars)) {\n\t\t\tthrow new ShareNotFound('Calendar is not shared with the sharee');\n\t\t}\n","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/Federation/CalendarFederationProvider.php#L194-L230","documentation":"OCP\\Federation\\Exceptions\\BadRequestException thrown by CalendarFederationProvider::handleSyncCalendarNotification() when the SYNC_CALENDAR notification lacks 'calendarUrl' (CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL) or sends it empty. The calendarUrl is the remote calendar's URL used together with shareWith and sharedSecret in FederatedCalendarMapper::findByRemoteUrl(), so an empty value cannot locate the accepted share.","triggerScenarios":"POSTing a 'SYNC_CALENDAR' federation notification without the 'calendarUrl' key or with an empty string; partial payloads from custom notification senders.","commonSituations":"Custom sync clients omitting the url prop; refactors that renamed the array key; notification payloads truncated by size limits; tests with incomplete fixtures.","solutions":["Include a non-empty 'calendarUrl' in the SYNC_CALENDAR notification payload, matching the URL the calendar was originally shared with.","Reuse CalendarFederationNotifier to construct the notification so props cannot be dropped.","Validate the outbound payload against the notifier's prop constants before sending."],"exampleFix":"// before\n$notification = ['sharedSecret' => $secret, 'shareWith' => $cloudId];\n\n// after\n$notification = [\n\t'sharedSecret' => $secret,\n\t'shareWith' => $cloudId,\n\t'calendarUrl' => $remoteCalendarUrl, // CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL\n];","handlingStrategy":"validation","validationCode":"use OCA\\DAV\\CalDAV\\Federation\\CalendarFederationNotifier;\n$notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL] ??= null;\nif (empty($notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_CALENDAR_URL])) {\n    throw new \\InvalidArgumentException('calendarUrl is required for SYNC_CALENDAR notifications');\n}","typeGuard":null,"tryCatchPattern":"try {\n    $provider->notificationReceived('SYNC_CALENDAR', 'calendar', $notification);\n} catch (\\OCP\\Federation\\Exceptions\\BadRequestException $e) {\n    // getReturnMessage() shows 'calendarUrl' missing; populate it and resend\n}","preventionTips":["Reuse the exact remote calendar URL from share creation in sync notifications.","Centralize notification assembly so props are never dropped by refactors."],"tags":["caldav","calendar","federation","bad-request","notification","sync","required-field"],"backgroundTag":"missing-required-field","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}