{"record":{"id":"7958cd5e2e1b9a6d","repo":"nextcloud/server","slug":"please-specify-a-calendar-name-or-birthday","errorCode":null,"errorMessage":"Please specify a calendar name or --birthday","messagePattern":"Please specify a calendar name or --birthday","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/Command/DeleteCalendar.php","lineNumber":75,"sourceCode":"\tprotected function execute(\n\t\tInputInterface $input,\n\t\tOutputInterface $output,\n\t): int {\n\t\t/** @var string $user */\n\t\t$user = $input->getArgument('uid');\n\t\tif (!$this->userManager->userExists($user)) {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t'User <' . $user . '> is unknown.');\n\t\t}\n\n\t\t$birthday = $input->getOption('birthday');\n\t\tif ($birthday !== false) {\n\t\t\t$name = BirthdayService::BIRTHDAY_CALENDAR_URI;\n\t\t} else {\n\t\t\t/** @var string $name */\n\t\t\t$name = $input->getArgument('name');\n\t\t\tif (!$name) {\n\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t'Please specify a calendar name or --birthday');\n\t\t\t}\n\t\t}\n\n\t\t$calendarInfo = $this->calDav->getCalendarByUri(\n\t\t\t'principals/users/' . $user,\n\t\t\t$name);\n\t\tif ($calendarInfo === null) {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t'User <' . $user . '> has no calendar named <' . $name . '>. You can run occ dav:list-calendars to list calendars URIs for this user.');\n\t\t}\n\n\t\t$calendar = new Calendar(\n\t\t\t$this->calDav,\n\t\t\t$calendarInfo,\n\t\t\t$this->l10n,\n\t\t\t$this->config,\n\t\t\t$this->logger","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/DeleteCalendar.php#L57-L93","documentation":"InvalidArgumentException from occ dav:delete-calendar when neither the optional calendar name argument nor the --birthday option was supplied, leaving no deletion target. The command requires exactly one of: a calendar name/URI argument, or --birthday to target the auto-generated birthday calendar.","triggerScenarios":"occ dav:delete-calendar <uid> with no name argument and no --birthday flag — e.g. in wrappers that forward optional arguments and end up passing none.","commonSituations":"Wrapper scripts that pass \"$@\" with unset optional args; interactive use where the user forgets the second argument; automation templates with empty variables.","solutions":["Pass the calendar URI as the name argument: occ dav:delete-calendar <uid> <uri>","Or target the birthday calendar explicitly with --birthday","Guard wrappers: require a non-empty name or the --birthday flag before invoking"],"exampleFix":"# before: neither a name nor --birthday\nocc dav:delete-calendar jdoe\n# after: pass the calendar URI or target the birthday calendar\nocc dav:delete-calendar jdoe personal\nocc dav:delete-calendar jdoe --birthday","handlingStrategy":"validation","validationCode":"#!/bin/bash\nuid=\"$1\"; name=\"$2\"; birthday=\"$3\" # 'yes' to target the birthday calendar\nif [ -z \"$name\" ] && [ \"$birthday\" != 'yes' ]; then\n  echo 'specify a calendar URI or --birthday' >&2; exit 1\nfi\nocc dav:delete-calendar \"$uid\" ${name:+\"$name\"} ${birthday:+--birthday}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require a non-empty target in wrappers before forwarding to occ","Forward optional arguments explicitly rather than via empty strings"],"tags":["occ","cli","caldav","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}