{"record":{"id":"c9753d89b8a9f35e","repo":"nextcloud/server","slug":"user-user-in-unknown","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/CreateAddressBook.php","lineNumber":43,"sourceCode":"\n\t#[\\Override]\n\tprotected function configure(): void {\n\t\t$this\n\t\t\t->setName('dav:create-addressbook')\n\t\t\t->setDescription('Create a dav addressbook')\n\t\t\t->addArgument('user',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User for whom the addressbook will be created')\n\t\t\t->addArgument('name',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'Name of the addressbook');\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\n\t\t$name = $input->getArgument('name');\n\t\t$this->cardDavBackend->createAddressBook(\"principals/users/$user\", $name, []);\n\t\treturn self::SUCCESS;\n\t}\n}\n","sourceCodeStart":25,"sourceCodeEnd":51,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/CreateAddressBook.php#L25-L51","documentation":"InvalidArgumentException from the occ dav:create-address-book command when the required user argument does not exist (userExists() returns false). The command refuses to create the address book for a nonexistent principal.","triggerScenarios":"occ dav:create-address-book <user> <name> where user is misspelled, is an email instead of the backend user id, or was deleted.","commonSituations":"Provisioning scripts using email addresses as user ids; case-sensitive ids copied from another environment; LDAP ids that differ from display names.","solutions":["Get the exact id from occ user:list and re-run","Validate with occ user:info <uid> in scripts before creating resources","Quote arguments to avoid shell splitting of ids containing dots"],"exampleFix":"# before\nocc dav:create-address-book john.doe@example.com 'Customers'\n# after: user id, not email\nocc user:list\nocc dav:create-address-book john 'Customers'","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-address-book \"$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","carddav","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"}