{"record":{"id":"59272e18fa65f254","repo":"nextcloud/server","slug":"user-user-is-unknown-59272e","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/ListCalendarShares.php","lineNumber":60,"sourceCode":"\t\t$this->addArgument(\n\t\t\t'uid',\n\t\t\tInputArgument::REQUIRED,\n\t\t\t'User whose calendar shares will be listed'\n\t\t);\n\t\t$this->addOption(\n\t\t\t'calendar-id',\n\t\t\t'',\n\t\t\tInputOption::VALUE_REQUIRED,\n\t\t\t'List only shares for the given calendar id id',\n\t\t\tnull,\n\t\t);\n\t}\n\n\t#[\\Override]\n\tprotected function execute(InputInterface $input, OutputInterface $output): int {\n\t\t$user = (string)$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$principal = $this->principal->getPrincipalByPath('principals/users/' . $user);\n\t\tif ($principal === null) {\n\t\t\tthrow new \\InvalidArgumentException(\"Unable to fetch principal for user $user\");\n\t\t}\n\n\t\t$memberships = array_merge(\n\t\t\t[$principal['uri']],\n\t\t\t$this->principal->getGroupMembership($principal['uri']),\n\t\t\t$this->principal->getCircleMembership($principal['uri']),\n\t\t);\n\n\t\t$shares = $this->mapper->getSharesByPrincipals($memberships, 'calendar');\n\n\t\t$calendarId = $input->getOption('calendar-id');\n\t\tif ($calendarId !== null) {\n\t\t\t$shares = array_filter($shares, fn ($share) => $share['resourceid'] === (int)$calendarId);","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/ListCalendarShares.php#L42-L78","documentation":"Thrown by occ dav:list-calendar-shares when the required uid argument fails IUserManager::userExists(). It is the first of two guards in execute(): the user check precedes the principal lookup, so hitting it means the user backend itself does not know the id. No share data is read.","triggerScenarios":"`occ dav:list-calendar-shares <uid>` with a non-existent, deleted, or externally-provisioned-but-unavailable user id.","commonSituations":"Typo in uid; user removed after the admin copied the id; LDAP backend unreachable so the user resolves as absent; automation running against the wrong instance.","solutions":["Verify the id with `occ user:info <uid>` / `occ user:list`","Check external user backends (LDAP connection, `occ user:sync`) if the user should exist","Re-run with the corrected uid"],"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-calendar-shares \"$uid\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-validate user ids immediately before running, not from cached lists","Automate against the same environment the ids came from","Handle external-backend outages as a distinct failure from typos"],"tags":["dav","calendar","shares","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"}