{"record":{"id":"5e020f1a746076fa","repo":"nextcloud/server","slug":"user-userorigin-is-unknown","errorCode":null,"errorMessage":"User <$userOrigin> is unknown.","messagePattern":"User <\\$userOrigin> is unknown\\.","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"apps/dav/lib/Command/MoveCalendar.php","lineNumber":67,"sourceCode":"\t\t\t\t'Name of the calendar to move')\n\t\t\t->addArgument('sourceuid',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'User who currently owns the calendar')\n\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')) {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Command/MoveCalendar.php#L49-L85","documentation":"First user guard in occ dav:move-calendar: the sourceuid argument (the user who currently owns the calendar) fails IUserManager::userExists(). It fires before the destination check and before any calendar lookup, so no data is touched. The move transfers calendar ownership between two existing users, and both endpoints are validated first.","triggerScenarios":"`occ dav:move-calendar <sourceuid> <destinationuid> <name>` with a source uid that is typo'd or deleted.","commonSituations":"User was deleted before the migration ran; copy-paste of the wrong uid during account consolidation; LDAP user not resolved at run time.","solutions":["Confirm both uids with `occ user:info <sourceuid>` and `occ user:info <destinationuid>`","Re-run with the corrected source uid","If migrating away from a deleted user, restore the account first or move data via calendar export/import instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nsrc=\"$1\"; dst=\"$2\"; name=\"$3\"\nfor u in \"$src\" \"$dst\"; do\n  occ user:info \"$u\" >/dev/null 2>&1 || { echo \"Unknown user: $u\" >&2; exit 1; }\ndone\nocc dav:move-calendar \"$src\" \"$dst\" \"$name\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate both endpoints of every move before running it","Snapshot/export calendars before account-consolidation runs","Run the move as part of a runbook that creates both accounts first"],"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"}