{"record":{"id":"62c00fe0fbeba2d9","repo":"nextcloud/server","slug":"user-user-in-unknown-62c00f","errorCode":null,"errorMessage":"User <$user> in unknown.","messagePattern":"User <\\$user> in unknown\\.","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/Command/CreateCalendar.php","lineNumber":61,"sourceCode":"\n\t#[\\Override]\n\tprotected function configure(): void {\n\t\t$this\n\t\t\t->setName('dav:create-calendar')\n\t\t\t->setDescription('Create a dav calendar')\n\t\t\t->addArgument('user',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User for whom the calendar will be created')\n\t\t\t->addArgument('name',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'Name of the calendar');\n\t}\n\n\t#[\\Override]\n\tprotected function execute(InputInterface $input, OutputInterface $output): int {\n\t\t$user = $input->getArgument('user');\n\t\tif (!$this->userManager->userExists($user)) {\n\t\t\tthrow new \\InvalidArgumentException(\"User <$user> in unknown.\");\n\t\t}\n\t\t$principalBackend = new Principal(\n\t\t\t$this->userManager,\n\t\t\t$this->groupManager,\n\t\t\tServer::get(IAccountManager::class),\n\t\t\tServer::get(\\OCP\\Share\\IManager::class),\n\t\t\tServer::get(IUserSession::class),\n\t\t\tServer::get(IAppManager::class),\n\t\t\tServer::get(ProxyMapper::class),\n\t\t\tServer::get(KnownUserService::class),\n\t\t\tServer::get(IConfig::class),\n\t\t\tServer::get(IFactory::class),\n\t\t);\n\t\t$random = Server::get(ISecureRandom::class);\n\t\t$logger = Server::get(LoggerInterface::class);\n\t\t$dispatcher = Server::get(IEventDispatcher::class);\n\t\t$config = Server::get(IConfig::class);\n\t\t$name = $input->getArgument('name');","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/CreateCalendar.php#L43-L79","documentation":"InvalidArgumentException from the occ dav:create-calendar command when the required user argument does not exist (userExists() returns false). It aborts before constructing the principal backend and creating the calendar.","triggerScenarios":"occ dav:create-calendar <user> <name> with a misspelled/deleted user id or an email address passed as the user argument.","commonSituations":"Automated provisioning with unvalidated user input; environments where LDAP uid differs from mail; scripts reused across instances with different user bases.","solutions":["Look up the id with occ user:list and re-run with it","Pre-check occ user:info <uid> in automation","Prefer provisioning shares/calendars from your user directory of record rather than free-text input"],"exampleFix":"# before\nocc dav:create-calendar jane.doe@example.com 'Work'\n# after\nocc user:list\nocc dav:create-calendar jane 'Work'","handlingStrategy":"validation","validationCode":"#!/bin/bash\nuid=\"$1\"; name=\"$2\"\nocc user:info \"$uid\" >/dev/null 2>&1 || { echo \"unknown user: $uid\" >&2; exit 1; }\nocc dav:create-calendar \"$uid\" \"$name\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the uid against occ user:list in provisioning pipelines","Pass backend user ids, never email addresses","Quote arguments containing dots or spaces"],"tags":["occ","cli","caldav","user-not-found","provisioning"],"backgroundTag":"user-not-found","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}