{"record":{"id":"7516f66abc633727","repo":"nextcloud/all-in-one","slug":"the-path-must-start-with-and-must-not-end-wit","errorCode":null,"errorMessage":"The path must start with '/', and must not end with '/'! Another option is to use the docker volume name 'nextcloud_aio_backupdir'.","messagePattern":"The path must start with '/', and must not end with '/'! Another option is to use the docker volume name 'nextcloud_aio_backupdir'\\.","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":743,"sourceCode":"    }\n\n    private function validateBorgLocationVars(string $location, string $repo) : void {\n        if ($location === '' && $repo === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter a path or a remote repo url!\");\n        } elseif ($location !== '' && $repo !== '') {\n            throw new InvalidSettingConfigurationException(\"Location and remote repo url are mutually exclusive!\");\n        }\n\n        if ($location !== '') {\n            $isValidPath = false;\n            if (str_starts_with($location, '/') && !str_ends_with($location, '/')) {\n                $isValidPath = true;\n            } elseif ($location === 'nextcloud_aio_backupdir') {\n                $isValidPath = true;\n            }\n\n            if (!$isValidPath) {\n                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'.\");\n            }\n\n            // 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, \"@\")) {","sourceCodeStart":725,"sourceCodeEnd":761,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L725-L761","documentation":"Path-format rule in validateBorgLocationVars(): a local borg backup location must start with '/' and must not end with '/', or be exactly the docker volume name 'nextcloud_aio_backupdir'. Anything else — relative paths, trailing slashes, Windows paths, pasted quotes — throws InvalidSettingConfigurationException → HTTP 422 in the AIO UI. The path denotes a bind-mount source on the Docker host that the AIO interface manages.","triggerScenarios":"Submitting 'mnt/backup' (no leading slash), '/mnt/backup/' (trailing slash), 'backup' (relative), 'C:\\backup' (Windows-style), or a value with stray quotes/spaces from copy-paste; anything that is not the literal volume name 'nextcloud_aio_backupdir'.","commonSituations":"Copy-paste from tutorials that add a trailing slash; Windows users entering drive-letter paths; users unaware of the pre-created volume option.","solutions":["Use an absolute path with no trailing slash: '/mnt/backup'","Or submit exactly 'nextcloud_aio_backupdir' to use the pre-created docker volume","Remove quotes, backslashes and surrounding whitespace introduced by copy-paste"],"exampleFix":"// before\nborg_backup_host_location = 'mnt/backup/'\n// after\nborg_backup_host_location = '/mnt/backup'","handlingStrategy":"validation","validationCode":"$isValidPath = (str_starts_with($location, '/') && !str_ends_with($location, '/'))\n    || $location === 'nextcloud_aio_backupdir';\nif (trim($location) !== '' && !$isValidPath) {\n    $errors[] = \"Path must start with '/' and not end with '/' (or be 'nextcloud_aio_backupdir')\";\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":["Use a pattern check client-side: ^/.+[^/]$ or the exact volume name","Strip quotes, backslashes and whitespace from pasted paths","Offer the 'nextcloud_aio_backupdir' volume as a dropdown option to avoid typing errors"],"tags":["php","nextcloud-aio","borg-backup","path-validation","configuration"],"backgroundTag":"invalid-path-format","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}