nextcloud/server · error · InvalidArgumentException
User <$userDestination> is unknown.
Error message
User <$userDestination> is unknown.
What it means
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.
Source
Thrown at apps/dav/lib/Command/MoveCalendar.php:71
->addArgument('destinationuid',
InputArgument::REQUIRED,
'User who will receive the calendar')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force the migration by removing existing shares and renaming calendars in case of conflicts');
}
#[\Override]
protected function execute(InputInterface $input, OutputInterface $output): int {
$userOrigin = $input->getArgument('sourceuid');
$userDestination = $input->getArgument('destinationuid');
$this->io = new SymfonyStyle($input, $output);
if (!$this->userManager->userExists($userOrigin)) {
throw new \InvalidArgumentException("User <$userOrigin> is unknown.");
}
if (!$this->userManager->userExists($userDestination)) {
throw new \InvalidArgumentException("User <$userDestination> is unknown.");
}
$name = $input->getArgument('name');
$newName = null;
$calendar = $this->calDav->getCalendarByUri(self::URI_USERS . $userOrigin, $name);
if ($calendar === null) {
throw new \InvalidArgumentException("User <$userOrigin> has no calendar named <$name>. You can run occ dav:list-calendars to list calendars URIs for this user.");
}
// Calendar already exists
if ($this->calendarExists($userDestination, $name)) {
if ($input->getOption('force')) {
// Try to find a suitable name
$newName = $this->getNewCalendarName($userDestination, $name);
// If we didn't find a suitable value after all the iterations, give upView on GitHub (pinned to ecdeb153ff)
Solutions
- Create the destination user first (`occ user:add ...`) or fix the typo
- Verify with `occ user:info <destinationuid>`
- Re-run the move command
Defensive patterns
Strategy: validation
Validate before calling
#!/usr/bin/env bash
src="$1"; dst="$2"; name="$3"
occ user:info "$dst" >/dev/null 2>&1 || { echo "Destination user missing: $dst" >&2; exit 1; }
occ dav:move-calendar "$src" "$dst" "$name" Prevention
- Create the destination account before scheduling a move into it
- Confirm both uids resolve in the active backends (especially LDAP) pre-run
When it happens
Trigger: `occ dav:move-calendar <sourceuid> <destinationuid> <name>` where the receiving account does not exist (typo, not yet created, backend unavailable).
Common situations: Target account created later in a migration runbook than the move step; typo in destination uid; destination user deleted concurrently.
Related errors
- User <$userOrigin> is unknown.
- User $user is unknown
- User <$user> is unknown.
- User $user is unknown
- User <$userOrigin> has no calendar named <$name>. You can ru
AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17).
Data as JSON: /api/errors/8910995fd2e9af96.
Report an issue: GitHub.