{"record":{"id":"8910995fd2e9af96","repo":"nextcloud/server","slug":"user-userdestination-is-unknown","errorCode":null,"errorMessage":"User <$userDestination> is unknown.","messagePattern":"User <\\$userDestination> is unknown\\.","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/Command/MoveCalendar.php","lineNumber":71,"sourceCode":"\t\t\t->addArgument('destinationuid',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User who will receive the calendar')\n\t\t\t->addOption('force', 'f', InputOption::VALUE_NONE, 'Force the migration by removing existing shares and renaming calendars in case of conflicts');\n\t}\n\n\t#[\\Override]\n\tprotected function execute(InputInterface $input, OutputInterface $output): int {\n\t\t$userOrigin = $input->getArgument('sourceuid');\n\t\t$userDestination = $input->getArgument('destinationuid');\n\n\t\t$this->io = new SymfonyStyle($input, $output);\n\n\t\tif (!$this->userManager->userExists($userOrigin)) {\n\t\t\tthrow new \\InvalidArgumentException(\"User <$userOrigin> is unknown.\");\n\t\t}\n\n\t\tif (!$this->userManager->userExists($userDestination)) {\n\t\t\tthrow new \\InvalidArgumentException(\"User <$userDestination> is unknown.\");\n\t\t}\n\n\t\t$name = $input->getArgument('name');\n\t\t$newName = null;\n\n\t\t$calendar = $this->calDav->getCalendarByUri(self::URI_USERS . $userOrigin, $name);\n\n\t\tif ($calendar === null) {\n\t\t\tthrow new \\InvalidArgumentException(\"User <$userOrigin> has no calendar named <$name>. You can run occ dav:list-calendars to list calendars URIs for this user.\");\n\t\t}\n\n\t\t// Calendar already exists\n\t\tif ($this->calendarExists($userDestination, $name)) {\n\t\t\tif ($input->getOption('force')) {\n\t\t\t\t// Try to find a suitable name\n\t\t\t\t$newName = $this->getNewCalendarName($userDestination, $name);\n\n\t\t\t\t// If we didn't find a suitable value after all the iterations, give up","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/MoveCalendar.php#L53-L89","documentation":"Second user guard in occ dav:move-calendar: the destinationuid argument fails IUserManager::userExists(), while the source user already passed. Thrown before the calendar lookup, so nothing is modified. The destination is the account that will receive ownership of the calendar.","triggerScenarios":"`occ dav:move-calendar <sourceuid> <destinationuid> <name>` where the receiving account does not exist (typo, not yet created, backend unavailable).","commonSituations":"Target account created later in a migration runbook than the move step; typo in destination uid; destination user deleted concurrently.","solutions":["Create the destination user first (`occ user:add ...`) or fix the typo","Verify with `occ user:info <destinationuid>`","Re-run the move command"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nsrc=\"$1\"; dst=\"$2\"; name=\"$3\"\nocc user:info \"$dst\" >/dev/null 2>&1 || { echo \"Destination user missing: $dst\" >&2; exit 1; }\nocc dav:move-calendar \"$src\" \"$dst\" \"$name\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create the destination account before scheduling a move into it","Confirm both uids resolve in the active backends (especially LDAP) pre-run"],"tags":["dav","calendar","migration","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"}