nextcloud/all-in-one · error · InvalidSettingConfigurationException

Please enter a path or a remote repo url!

Error message

Please enter a path or a remote repo url!

What it means

ConfigurationManager::setBorgLocationVars() (and setBorgRestoreLocationVarsAndPassword(), which reuses the same validator) requires exactly one of the two backup-location inputs: a local path ($location) or a borg remote repository URL ($repo). Submitting the AIO backup or restore form with both fields empty throws InvalidSettingConfigurationException → HTTP 422 with this message shown in the interface. Note that the controller calls setBorgLocationVars whenever either form key is present in the POST body, even if both values are empty strings.

Source

Thrown at php/src/Data/ConfigurationManager.php:729

            return "";
        }
        return 'dc=' . implode(',dc=', explode('.', $domain));
    }

    /**
     * @throws InvalidSettingConfigurationException
     */
    public function setBorgLocationVars(string $location, string $repo) : void {
        $this->validateBorgLocationVars($location, $repo);
        $this->startTransaction();
        $this->borgBackupHostLocation = $location;
        $this->borgRemoteRepo = $repo;
        $this->commitTransaction();
    }

    private function validateBorgLocationVars(string $location, string $repo) : void {
        if ($location === '' && $repo === '') {
            throw new InvalidSettingConfigurationException("Please enter a path or a remote repo url!");
        } elseif ($location !== '' && $repo !== '') {
            throw new InvalidSettingConfigurationException("Location and remote repo url are mutually exclusive!");
        }

        if ($location !== '') {
            $isValidPath = false;
            if (str_starts_with($location, '/') && !str_ends_with($location, '/')) {
                $isValidPath = true;
            } elseif ($location === 'nextcloud_aio_backupdir') {
                $isValidPath = true;
            }

            if (!$isValidPath) {
                throw new InvalidSettingConfigurationException("The path must start with '/', and must not end with '/'! Another option is to use the docker volume name 'nextcloud_aio_backupdir'.");
            }

            // Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore
            // See https://github.com/nextcloud/all-in-one/issues/6607

View on GitHub (pinned to 6b788eec5e)

Solutions

  1. Fill in exactly one of the two fields: an absolute path like '/mnt/backup', the docker volume name 'nextcloud_aio_backupdir', or a remote repo URL like 'ssh://user@host:22/./repo'
  2. If the goal was to clear the backup location, use the dedicated delete action (deleteBorgBackupLocationItems) instead of submitting empty values
  3. Check for whitespace-only values — trim before submitting

Example fix

// before
borg_backup_host_location = ''
borg_remote_repo = ''
// after
borg_backup_host_location = '/mnt/aio-backup'
borg_remote_repo = ''
Defensive patterns

Strategy: validation

Validate before calling

$hasPath = trim($location) !== '';
$hasRepo = trim($repo) !== '';
if (!$hasPath && !$hasRepo) {
    $errors[] = 'Provide a backup path or a remote repo url';
} elseif ($hasPath && $hasRepo) {
    $errors[] = 'Provide only one of path or remote repo';
}

Try / catch

use AIO\Data\InvalidSettingConfigurationException;

try {
    $configurationManager->setBorgLocationVars($location, $repo);
} catch (InvalidSettingConfigurationException $e) {
    $formErrors[] = $e->getMessage(); // shown verbatim in the AIO UI
}

Prevention

When it happens

Trigger: Clicking submit on the Borg backup-location form without filling either 'borg_backup_host_location' or 'borg_remote_repo'; a POST to /api/docker/config whose body contains one of the keys but with empty values; the restore form submitted with only the password filled in.

Common situations: Accidental submit of an empty form; client scripts posting the config endpoint with empty strings for both keys; whitespace-only input that looks non-empty to the user.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nextcloud/all-in-one@6b788eec5e (2026-08-21). Data as JSON: /api/errors/6f76109db25696f1. Report an issue: GitHub.