nextcloud/all-in-one · error · InvalidSettingConfigurationException

The remote repo must contain '@'. For valid urls, see the re

Error message

The remote repo must contain '@'. For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls

What it means

First rule of validateBorgRemoteRepo() (called from validateBorgLocationVars() when only a remote repo was given): a borg remote repository URL must contain '@' — the user part of 'user@host:repo' shorthand or of full URLs like 'ssh://user@host:port/repo'. Missing '@' throws InvalidSettingConfigurationException → HTTP 422, and the message links borg's repository-URL documentation.

Source

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

            }

            // 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
            if (str_starts_with($location . '/', rtrim($this->nextcloudDatadirMount, '/') . '/')) {
                throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $this->nextcloudDatadirMount);
            }

        } else {
            $this->validateBorgRemoteRepo($repo);
        }
    }

    private function validateBorgRemoteRepo(string $repo) : void {
        $commonMsg = "For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls";
        if ($repo === "") {
            // Ok, remote repo is optional
        } elseif (!str_contains($repo, "@")) {
            throw new InvalidSettingConfigurationException("The remote repo must contain '@'. $commonMsg");
        } elseif (!str_contains($repo, ":")) {
            throw new InvalidSettingConfigurationException("The remote repo must contain ':'. $commonMsg");
        }
    }

    public function deleteBorgBackupLocationItems() : void {
        // Delete the variables
        $this->startTransaction();
        $this->borgBackupHostLocation = '';
        $this->borgRemoteRepo = '';
        $this->commitTransaction();

        // Also delete the borg config file to be able to start over
        if (file_exists(DataConst::GetBackupKeyFile())) {
            if (unlink(DataConst::GetBackupKeyFile())) {
                error_log('borg.config file deleted to be able to start over.');
            }
        }

View on GitHub (pinned to 6b788eec5e)

Solutions

  1. Include the ssh user, e.g. 'ssh://borg@backup.example.com:22/./repo' or the shorthand 'borg@backup.example.com:./repo'
  2. Check the borg repository-URL docs linked in the message for all supported schemes
  3. If a local path was intended, clear the remote-repo field and use the path field instead

Example fix

// before
borg_remote_repo = 'ssh://backup.example.com:22/./repo'
// after
borg_remote_repo = 'ssh://borg@backup.example.com:22/./repo'
Defensive patterns

Strategy: validation

Validate before calling

if (trim($repo) !== '' && !str_contains($repo, '@')) {
    $errors[] = "Remote repo url must contain '@' (user@host), e.g. ssh://borg@host:22/./repo";
}

Try / catch

use AIO\Data\InvalidSettingConfigurationException;

try {
    $configurationManager->setBorgLocationVars($location, $repo);
} catch (InvalidSettingConfigurationException $e) {
    $formErrors[] = $e->getMessage(); // includes the borg URL docs link
}

Prevention

When it happens

Trigger: Submitting 'ssh://host:22/./repo' (no user), 'host:/repo', or a bare path-like string as the remote repo; a URL assembled by string concatenation that dropped the user segment.

Common situations: Users unfamiliar with borg's ssh URL syntax; scripts building the URL from parts and omitting the username; copy from a tutorial that used key-based host aliases.

Related errors


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