{"record":{"id":"e555a0796be280ec","repo":"nextcloud/all-in-one","slug":"please-enter-the-password","errorCode":null,"errorMessage":"Please enter the password!","messagePattern":"Please enter the password!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":790,"sourceCode":"        $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\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setBorgRestoreLocationVarsAndPassword(string $location, string $repo, string $password) : void {\n        $this->validateBorgLocationVars($location, $repo);\n\n        if ($password === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter the password!\");\n        }\n\n        $this->startTransaction();\n        $this->borgBackupHostLocation = $location;\n        $this->borgRemoteRepo = $repo;\n        $this->borgRestorePassword = $password;\n        $this->instanceRestoreAttempt = true;\n        $this->commitTransaction();\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function changeMasterPassword(string $currentPassword, string $newPassword) : void {\n        if ($currentPassword === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter your current password.\");\n        }\n","sourceCodeStart":772,"sourceCodeEnd":808,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L772-L808","documentation":"In ConfigurationManager::setBorgRestoreLocationVarsAndPassword(): after the location/repo validation passes, an empty borg repository password is rejected — restoring a borg backup requires the encryption passphrase the repository was created with. Throws InvalidSettingConfigurationException → HTTP 422 shown on the AIO restore form; on success the password is stored as borg_restore_password and instanceRestoreAttempt is set.","triggerScenarios":"Submitting the restore form with 'borg_restore_password' empty or whitespace; location and repo filled but the password field forgotten; form resubmission after an earlier validation error cleared the field.","commonSituations":"Users who did not record the borg passphrase displayed when daily backups were enabled; the password field not surviving a round-trip of a failed submit.","solutions":["Enter the borg backup password that was shown when the backup repository was created (displayed once in the AIO interface when backups were set up)","Look it up in your password manager or the notes from the initial AIO backup setup","If the passphrase is truly lost, an encrypted borg backup cannot be restored — there is no recovery mechanism"],"exampleFix":"// before\nborg_restore_host_location = '/mnt/backup'\nborg_restore_password = ''\n// after\nborg_restore_host_location = '/mnt/backup'\nborg_restore_password = '<the borg repo password>'","handlingStrategy":"validation","validationCode":"if (trim($password) === '') {\n    $errors[] = 'The borg restore password is required';\n}","typeGuard":null,"tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->setBorgRestoreLocationVarsAndPassword($location, $repo, $password);\n} catch (InvalidSettingConfigurationException $e) {\n    $formErrors[] = $e->getMessage();\n}","preventionTips":["Record the borg passphrase in a password manager the day backups are enabled","Make the restore form's password field required (HTML required attribute)","Preserve entered values across failed submits so users do not lose typed input"],"tags":["php","nextcloud-aio","borg-restore","password","configuration","input-validation"],"backgroundTag":"missing-required-field","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}