atuinsh/atuin · error

please provide the current password

Error message

please provide the current password

What it means

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.

Solutions

  1. Set `--current-password` to the actual current password
  2. Ensure the environment variable holding the password is exported and non-empty before running
  3. Enter the current password when prompted instead of pressing Enter on an empty line

Example fix

// before
atuin account change-password --current-password "$OLD_PW"   # OLD_PW unset
// after
: "${OLD_PW:?OLD_PW must be set}"
atuin account change-password --current-password "$OLD_PW"
Defensive patterns

Strategy: validation

Validate before calling

: "${OLD_PW:?current password must be set}"
[ -n "$OLD_PW" ] || exit 1

Try / catch

atuin account change-password --current-password "$OLD_PW" ... || { echo 'empty or wrong password'; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: CI scripts with unset secret env vars; shell quoting mistakes (`$ATUIN_OLD_PASSWORD` not exported); pasting an empty line at the interactive prompt.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of atuinsh/atuin@900007c480 (2026-09-19). Data as JSON: /api/errors/4e3af01eaebf4a89. Report an issue: GitHub.

Appendix: source

Thrown at crates/atuin/src/command/client/account/change_password.rs:34

    #[clap(long, short)]
    pub totp_code: Option<String>,
}

impl Cmd {
    pub async fn run(&self, settings: &Settings) -> Result<()> {
        if !settings.logged_in().await? {
            bail!("You are not logged in");
        }

        let client = auth::auth_client(settings).await;

        let current_password = self.current_password.clone().unwrap_or_else(|| {
            prompt_password("Please enter the current password: ")
                .expect("Failed to read from input")
        });

        if current_password.is_empty() {
            bail!("please provide the current password");
        }

        let new_password = self.new_password.clone().unwrap_or_else(|| {
            prompt_password("Please enter the new password: ").expect("Failed to read from input")
        });

        if new_password.is_empty() {
            bail!("please provide a new password");
        }

        let mut totp_code = self.totp_code.clone();

        loop {
            let response = client
                .change_password(&current_password, &new_password, totp_code.as_deref())
                .await?;

            match response {

View on GitHub (pinned to 900007c480)