{"record":{"id":"2aac13d152e74bd9","repo":"nextcloud/all-in-one","slug":"the-remote-repo-must-contain-for-valid-urls-2aac13","errorCode":null,"errorMessage":"The remote repo must contain ':'. For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls","messagePattern":"The remote repo must contain ':'\\. For valid urls, see the remote examples at https://borgbackup\\.readthedocs\\.io/en/stable/usage/general\\.html#repository-urls","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":764,"sourceCode":"            // Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore\n            // See https://github.com/nextcloud/all-in-one/issues/6607\n            if (str_starts_with($location . '/', rtrim($this->nextcloudDatadirMount, '/') . '/')) {\n                throw new InvalidSettingConfigurationException(\"The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to \" . $this->nextcloudDatadirMount);\n            }\n\n        } else {\n            $this->validateBorgRemoteRepo($repo);\n        }\n    }\n\n    private function validateBorgRemoteRepo(string $repo) : void {\n        $commonMsg = \"For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls\";\n        if ($repo === \"\") {\n            // Ok, remote repo is optional\n        } elseif (!str_contains($repo, \"@\")) {\n            throw new InvalidSettingConfigurationException(\"The remote repo must contain '@'. $commonMsg\");\n        } elseif (!str_contains($repo, \":\")) {\n            throw new InvalidSettingConfigurationException(\"The remote repo must contain ':'. $commonMsg\");\n        }\n    }\n\n    public function deleteBorgBackupLocationItems() : void {\n        // Delete the variables\n        $this->startTransaction();\n        $this->borgBackupHostLocation = '';\n        $this->borgRemoteRepo = '';\n        $this->commitTransaction();\n\n        // Also delete the borg config file to be able to start over\n        if (file_exists(DataConst::GetBackupKeyFile())) {\n            if (unlink(DataConst::GetBackupKeyFile())) {\n                error_log('borg.config file deleted to be able to start over.');\n            }\n        }\n    }\n","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L746-L782","documentation":"Second rule of validateBorgRemoteRepo(): after the '@' check, the repo string must also contain ':' — separating host from path in borg's 'user@host:path' shorthand or marking host:port in full 'ssh://user@host:port/...' URLs. A value like 'borg@backup.example.com' (host but no path) throws InvalidSettingConfigurationException → HTTP 422 with a link to borg's repository-URL docs.","triggerScenarios":"Submitting 'borg@backup.example.com' without the repository path; a truncated copy-paste that lost everything after the host; edits of shell history that accidentally deleted the colon.","commonSituations":"First-time borg users omitting the path portion of the ssh shorthand; URLs damaged during copy-paste or templating.","solutions":["Append the path with a colon: 'borg@backup.example.com:./repo', or use the full URL 'ssh://borg@backup.example.com:22/./repo'","Verify the string contains both '@' and ':' before submitting","Consult the linked borg general-usage docs for the valid URL forms"],"exampleFix":"// before\nborg_remote_repo = 'borg@backup.example.com'\n// after\nborg_remote_repo = 'borg@backup.example.com:./repo'","handlingStrategy":"validation","validationCode":"if (trim($repo) !== '' && (!str_contains($repo, '@') || !str_contains($repo, ':'))) {\n    $errors[] = \"Remote repo url must contain '@' and ':' — e.g. borg@host:./repo\";\n}","typeGuard":null,"tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->setBorgLocationVars($location, $repo);\n} catch (InvalidSettingConfigurationException $e) {\n    $formErrors[] = $e->getMessage();\n}","preventionTips":["Always include the repository path after the host ('user@host:./repo')","Test the URL with 'borg info <url>' before pasting it into AIO","Guard templates that interpolate only the host into the repo field"],"tags":["php","nextcloud-aio","borg-backup","url-validation","configuration"],"backgroundTag":"invalid-repository-url","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}