{"record":{"id":"1093b66e2e4bdb58","repo":"nextcloud/server","slug":"user-user-is-unknown-1093b6","errorCode":null,"errorMessage":"User <$user> is unknown.","messagePattern":"User <\\$user> is unknown\\.","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/Command/ListCalendars.php","lineNumber":41,"sourceCode":"\t) {\n\t\tparent::__construct();\n\t}\n\n\t#[\\Override]\n\tprotected function configure(): void {\n\t\t$this\n\t\t\t->setName('dav:list-calendars')\n\t\t\t->setDescription('List all calendars of a user')\n\t\t\t->addArgument('uid',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User for whom all calendars will be listed');\n\t}\n\n\t#[\\Override]\n\tprotected function execute(InputInterface $input, OutputInterface $output): int {\n\t\t$user = $input->getArgument('uid');\n\t\tif (!$this->userManager->userExists($user)) {\n\t\t\tthrow new \\InvalidArgumentException(\"User <$user> is unknown.\");\n\t\t}\n\n\t\t$calendars = $this->caldav->getCalendarsForUser(\"principals/users/$user\");\n\n\t\t$calendarTableData = [];\n\t\tforeach ($calendars as $calendar) {\n\t\t\t// skip birthday calendar\n\t\t\tif ($calendar['uri'] === BirthdayService::BIRTHDAY_CALENDAR_URI) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$readOnly = false;\n\t\t\t$readOnlyIndex = '{' . \\OCA\\DAV\\DAV\\Sharing\\Plugin::NS_OWNCLOUD . '}read-only';\n\t\t\tif (isset($calendar[$readOnlyIndex])) {\n\t\t\t\t$readOnly = $calendar[$readOnlyIndex];\n\t\t\t}\n\n\t\t\t$calendarTableData[] = [","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/ListCalendars.php#L23-L59","documentation":"Thrown by occ dav:list-calendars when the required uid argument does not match an existing user (IUserManager::userExists() false). The guard runs before getCalendarsForUser(), so no CalDav queries happen. Note the command explicitly skips the birthday calendar (BirthdayService::BIRTHDAY_CALENDAR_URI) when listing, but that is unrelated to this error.","triggerScenarios":"`occ dav:list-calendars <uid>` with a typo'd or deleted uid, or a user that only exists in an offline external backend.","commonSituations":"Admin scripts with hardcoded user lists drifting from reality; user deleted between operations; wrong environment (staging vs production); LDAP outage.","solutions":["Check the exact id via `occ user:list` or `occ user:info <uid>`","Fix typos / re-run with the correct uid","If the user should come from LDAP, verify the backend is connected and synced"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nuid=\"$1\"\nocc user:info \"$uid\" >/dev/null 2>&1 || { echo \"Unknown user: $uid\" >&2; exit 1; }\nocc dav:list-calendars \"$uid\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Seed CI/test instances with the users your scripts reference","Derive uid lists dynamically (occ user:list) instead of hardcoding","Distinguish 'user unknown' from 'user has no calendars' in script error handling"],"tags":["dav","calendar","occ","cli","user-validation"],"backgroundTag":"unknown-user-id","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}