atuinsh/atuin · error

please provide the current password

Error message

please provide the current password

What it means

The change-password command requires a non-empty current password. If `--current-password` was not passed, it prompts interactively; after resolution, an empty string is rejected with this bail rather than sending a useless request to the server.

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 c0c717ab04)

Solutions

  1. Pass the current password explicitly: `atuin account change-password --current-password '<pw>'`
  2. Ensure the env var feeding the flag is actually set before invoking
  3. Run interactively in a terminal so the prompt can read a real password
  4. Use a secrets manager to inject the value instead of an empty placeholder

Example fix

// before: PW unset, expands to empty
atuin account change-password --current-password "$PW"

// after
atuin account change-password --current-password "$CURRENT_PW" --new-password "$NEW_PW"
Defensive patterns

Strategy: validation

Validate before calling

[ -n "$CURRENT_PW" ] || { echo 'current password is empty' >&2; exit 1; }

Try / catch

if ! atuin account change-password --current-password "$CURRENT_PW" ...; then
  echo "Password rejected — check it is non-empty and correct" >&2
fi

Prevention

When it happens

Trigger: Passing `--current-password ''` (empty value) to `atuin account change-password`, or piping empty stdin (e.g. `echo '' |` or `</dev/null` in scripts) so the interactive prompt resolves to an empty string.

Common situations: Scripting the command headlessly and forgetting the flag; an env-var expansion like `--current-password "$PW"` where PW is unset; CI runners with no TTY supplying empty input.

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@c0c717ab04 (2026-09-12). Data as JSON: /api/errors/4e3af01eaebf4a89. Report an issue: GitHub.