{"record":{"id":"a4dc737f7f97665c","repo":"nextcloud/server","slug":"user-user-is-unknown-a4dc73","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/DeleteSubscription.php","lineNumber":53,"sourceCode":"\tprotected function configure(): void {\n\t\t$this\n\t\t\t->addArgument(\n\t\t\t\t'uid',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User who owns the calendar subscription'\n\t\t\t)\n\t\t\t->addArgument(\n\t\t\t\t'uri',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'URI of the calendar to be deleted'\n\t\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$uri = (string)$input->getArgument('uri');\n\t\tif ($uri === '') {\n\t\t\tthrow new \\InvalidArgumentException('Specify the URI of the calendar to be deleted');\n\t\t}\n\n\t\t$subscriptionInfo = $this->calDavBackend->getSubscriptionByUri(\n\t\t\t'principals/users/' . $user,\n\t\t\t$uri\n\t\t);\n\n\t\tif ($subscriptionInfo === null) {\n\t\t\tthrow new \\InvalidArgumentException(\"User $user has no calendar subscription with the URI $uri\");\n\t\t}\n\n\t\t$subscription = new CachedSubscription(\n\t\t\t$this->calDavBackend,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/DeleteSubscription.php#L35-L71","documentation":"InvalidArgumentException from occ dav:delete-subscription when the required uid argument does not match an existing user (userExists() returns false). The command aborts before looking up the subscription.","triggerScenarios":"occ dav:delete-subscription <uid> <uri> with a misspelled, deleted, or email-formatted user id.","commonSituations":"Cleanup jobs run after user deletion; automation reusing ids from another instance; LDAP ids differing from visible names.","solutions":["Resolve the exact id via occ user:list and re-run","Pre-validate with occ user:info <uid> in scripts","Order cleanup before user deletion in lifecycle automation"],"exampleFix":"# before\nocc dav:delete-subscription jdoe 'Company Holidays'\n# after\nocc user:list\nocc dav:delete-subscription jdoe company-holidays","handlingStrategy":"validation","validationCode":"#!/bin/bash\nuid=\"$1\"; uri=\"$2\"\nocc user:info \"$uid\" >/dev/null 2>&1 || { echo \"unknown user: $uid\" >&2; exit 1; }\nocc dav:delete-subscription \"$uid\" \"$uri\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the uid against occ user:list before cleanup jobs","Order subscription cleanup before user deletion in lifecycle scripts"],"tags":["occ","cli","caldav","user-not-found","subscription"],"backgroundTag":"user-not-found","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}