{"record":{"id":"801d92002192d666","repo":"nextcloud/server","slug":"parameters-missing-in-order-to-complete-the-reques-801d92","errorCode":null,"errorMessage":"Parameters missing in order to complete the request. Missing Parameters: shareWith","messagePattern":"Parameters missing in order to complete the request\\. Missing Parameters: shareWith","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apps/dav/lib/CalDAV/Federation/CalendarFederationProvider.php","lineNumber":208,"sourceCode":"\t/**\n\t * @return string[]\n\t */\n\t#[\\Override]\n\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);","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/Federation/CalendarFederationProvider.php#L190-L226","documentation":"OCP\\Federation\\Exceptions\\BadRequestException thrown by CalendarFederationProvider::handleSyncCalendarNotification() when the SYNC_CALENDAR notification array has no 'shareWith' key (CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH) or it is an empty string. The constructor renders the missing parameter names into the message, so the receiving remote server sees which prop to add. handleSyncCalendarNotification runs for notification type 'SYNC_CALENDAR' after the providerId check passed.","triggerScenarios":"POSTing a cloud federation notification of type 'SYNC_CALENDAR' whose notification payload omits 'shareWith' or sends it empty; custom clients that build the sync notification by hand instead of via CalendarFederationNotifier.","commonSituations":"Third-party senders guessing the notification schema; protocol drift between Nextcloud versions that renamed the prop; tests with partial fixtures; payload stripped by an over-aggressive sanitizer.","solutions":["Include a non-empty 'shareWith' (the sharee cloud id) in the SYNC_CALENDAR notification payload.","Build notifications with CalendarFederationNotifier so all required props are set consistently.","On receipt of the 400, inspect the validationErrors returned via BadRequestException::getReturnMessage() to confirm which prop is missing."],"exampleFix":"// before\n$notification = ['sharedSecret' => $secret, 'calendarUrl' => $url];\n\n// after\n$notification = [\n\t'sharedSecret' => $secret,\n\t'shareWith' => $shareeCloudId,      // CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH\n\t'calendarUrl' => $calendarUrl,\n];","handlingStrategy":"validation","validationCode":"use OCA\\DAV\\CalDAV\\Federation\\CalendarFederationNotifier;\n$notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH] ??= null;\nif (empty($notification[CalendarFederationNotifier::PROP_SYNC_CALENDAR_SHARE_WITH])) {\n    throw new \\InvalidArgumentException('shareWith 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    // validationErrors from getReturnMessage() name the missing prop; add it and retry\n}","preventionTips":["Build SYNC_CALENDAR notifications via CalendarFederationNotifier only.","Assert all notifier prop constants are non-empty in a pre-send check."],"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"}