{"record":{"id":"01bafbef9070363f","repo":"atuinsh/atuin","slug":"please-provide-a-new-password","errorCode":null,"errorMessage":"please provide a new password","messagePattern":"please provide a new password","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/account/change_password.rs","lineNumber":42,"sourceCode":"        }\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 {\n                MutateResponse::Success => break,\n                MutateResponse::TwoFactorRequired => {\n                    totp_code = Some(super::login::or_user_input(None, \"two-factor code\"));\n                }\n            }\n        }\n\n        println!(\"Account password successfully changed!\");","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/account/change_password.rs#L24-L60","documentation":"The new-password value is empty. After resolving `--new-password` or interactive prompt, an empty string is rejected because the server would refuse or weaken the account; `run` bails before issuing the change request.","triggerScenarios":"Passing `--new-password ''`; an empty environment variable interpolated into the flag; pressing Enter at the 'Please enter the new password:' prompt without typing anything.","commonSituations":"Scripted password rotation where the generator produced empty output; shell variable expansion with unset vars; accidental Enter-skip during interactive prompt.","solutions":["Provide a non-empty value via `--new-password`","Type the new password at the interactive prompt","Verify any password-generating step in your script actually produced output before invoking atuin"],"exampleFix":"// before\nNEW_PW=$(maybe-generate-pw)  # may be empty\natuin account change-password --new-password \"$NEW_PW\"\n// after\nNEW_PW=$(openssl rand -base64 24)\natuin account change-password --new-password \"$NEW_PW\"","handlingStrategy":"validation","validationCode":": \"${NEW_PW:?new password must be set}\"\n[ -n \"$NEW_PW\" ] || exit 1","typeGuard":null,"tryCatchPattern":"atuin account change-password --new-password \"$NEW_PW\" ... || { echo 'empty new password'; exit 1; }","preventionTips":["Generate passwords with a tool that fails loudly on empty output","Guard generator output: [ -n \"$NEW_PW\" ] || exit 1","Avoid interactive prompts in non-TTY automation"],"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"}