{"record":{"id":"5daad8c5dccb6589","repo":"nextcloud/all-in-one","slug":"please-enter-your-current-password","errorCode":null,"errorMessage":"Please enter your current password.","messagePattern":"Please enter your current password\\.","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":806,"sourceCode":"\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\n        if (!hash_equals($this->password, $currentPassword)) {\n            throw new InvalidSettingConfigurationException(\"The entered current password is not correct.\");\n        }\n\n        if ($newPassword === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter a new password.\");\n        }\n\n        if (strlen($newPassword) < 24) {\n            throw new InvalidSettingConfigurationException(\"New passwords must be >= 24 digits.\");\n        }\n\n        if (!preg_match(\"#^[a-zA-Z0-9 ]+$#\", $newPassword)) {\n            throw new InvalidSettingConfigurationException('Not allowed characters in the new password.');\n        }\n","sourceCodeStart":788,"sourceCodeEnd":824,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L788-L824","documentation":"First check in ConfigurationManager::changeMasterPassword(): the current-password field must be non-empty before anything else is validated. The controller invokes this method whenever the POST body contains 'current-master-password' or 'new-master-password'. Empty input throws InvalidSettingConfigurationException → HTTP 422 with this message in the AIO UI.","triggerScenarios":"Submitting the password-change form with 'current-master-password' blank while only filling the new password; the browser not autofilling the current field; scripted POSTs that include the new-password key but omit the current one.","commonSituations":"Users focusing on the new password and skipping the current one; password managers filling only one of the two fields.","solutions":["Fill in your current AIO login password (the one used to log into the AIO web interface)","If the filled password is then rejected, see the 'The entered current password is not correct.' handling","Paste carefully — leading/trailing whitespace counts as part of the value"],"exampleFix":"// before\ncurrent-master-password = ''\nnew-master-password = '<new password>'\n// after\ncurrent-master-password = '<current AIO password>'\nnew-master-password = '<new password>'","handlingStrategy":"validation","validationCode":"if (trim($currentPassword) === '') {\n    $errors[] = 'Current password is required';\n}","typeGuard":null,"tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->changeMasterPassword($currentPassword, $newPassword);\n} catch (InvalidSettingConfigurationException $e) {\n    $formErrors[] = $e->getMessage();\n}","preventionTips":["Mark the current-password field required in the form","Only post the password-change keys when both fields are filled","Trim pasted values to avoid whitespace-only submissions"],"tags":["php","nextcloud-aio","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"}