{"record":{"id":"4e3af01eaebf4a89","repo":"atuinsh/atuin","slug":"please-provide-the-current-password","errorCode":null,"errorMessage":"please provide the current password","messagePattern":"please provide the current password","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/account/change_password.rs","lineNumber":34,"sourceCode":"    #[clap(long, short)]\n    pub totp_code: Option<String>,\n}\n\nimpl Cmd {\n    pub async fn run(&self, settings: &Settings) -> Result<()> {\n        if !settings.logged_in().await? {\n            bail!(\"You are not logged in\");\n        }\n\n        let client = auth::auth_client(settings).await;\n\n        let current_password = self.current_password.clone().unwrap_or_else(|| {\n            prompt_password(\"Please enter the current password: \")\n                .expect(\"Failed to read from input\")\n        });\n\n        if current_password.is_empty() {\n            bail!(\"please provide the current password\");\n        }\n\n        let new_password = self.new_password.clone().unwrap_or_else(|| {\n            prompt_password(\"Please enter the new password: \").expect(\"Failed to read from input\")\n        });\n\n        if new_password.is_empty() {\n            bail!(\"please provide a new password\");\n        }\n\n        let mut totp_code = self.totp_code.clone();\n\n        loop {\n            let response = client\n                .change_password(&current_password, &new_password, totp_code.as_deref())\n                .await?;\n\n            match response {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/account/change_password.rs#L16-L52","documentation":"The current-password value is empty. The command accepts `--current-password` (or prompts interactively); if the resolved value is a zero-length string there is nothing to authenticate with, so `run` bails before contacting the server.","triggerScenarios":"Passing `--current-password ''` explicitly; scripting the command with an environment variable that is unset/empty (e.g. `--current-password \"$OLD_PW\"` where OLD_PW is empty); piping empty input so `prompt_password` reads an empty line.","commonSituations":"CI scripts with unset secret env vars; shell quoting mistakes (`$ATUIN_OLD_PASSWORD` not exported); pasting an empty line at the interactive prompt.","solutions":["Set `--current-password` to the actual current password","Ensure the environment variable holding the password is exported and non-empty before running","Enter the current password when prompted instead of pressing Enter on an empty line"],"exampleFix":"// before\natuin account change-password --current-password \"$OLD_PW\"   # OLD_PW unset\n// after\n: \"${OLD_PW:?OLD_PW must be set}\"\natuin account change-password --current-password \"$OLD_PW\"","handlingStrategy":"validation","validationCode":": \"${OLD_PW:?current password must be set}\"\n[ -n \"$OLD_PW\" ] || exit 1","typeGuard":null,"tryCatchPattern":"atuin account change-password --current-password \"$OLD_PW\" ... || { echo 'empty or wrong password'; exit 1; }","preventionTips":["Use ${VAR:?msg} guards for password env vars in scripts","Never pass literal empty strings for password flags","Verify secret injection (CI secrets mounts) before running"],"tags":["cli","validation","password"],"backgroundTag":"empty-required-field","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}