jdx/mise · error
cannot prompt for bootstrap secret
Error message
cannot prompt for bootstrap secret '{}' without an interactive terminal What it means
When a bootstrap secret has no stored value, mise prompts the user on stderr. If stdin/stderr is not an interactive terminal (CI, scripts, piped I/O), prompting is impossible and mise refuses rather than hanging or leaking a prompt into logs.
Solutions
- Provide the secret's value non-interactively (set the target env var or the secret store value) so no prompt is needed
- Run the command in an interactive terminal for the one-time prompt
- Mark the secret appropriately or use a fallback/allow_empty if the tooling supports it for non-critical secrets
- In CI, provision secrets from your CI secret manager before invoking mise
Example fix
// before (CI)
- run: mise bootstrap apply
// after
- run: mise bootstrap apply
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} Defensive patterns
Strategy: fallback
Validate before calling
// ensure the value is available before running non-interactively
if std::env::var("DEPLOY_TOKEN").is_err() && !is_interactive() {
panic!("DEPLOY_TOKEN must be provided for non-interactive bootstrap");
} Type guard
fn can_prompt() -> bool {
console::user_attended_stderr()
} Try / catch
match bootstrap::apply(opts) {
Err(e) if e.to_string().contains("without an interactive terminal") => {
eprintln!("set the secret env var or run interactively: {}");
std::process::exit(2);
}
other => other?,
} Prevention
- Provision all bootstrap secrets via env or a store before CI/scheduled runs
- Run one-time prompting commands in a real terminal, not through pipes
- Check user_attended_stderr (TTY presence) before attempting interactive bootstrap
When it happens
Trigger: resolve_declaration reaches prompt_value for a secret with no cached/resolved value while console::user_attended_stderr() is false — e.g. `mise bootstrap apply` under CI, inside a cron/scheduled task, or with output redirected.
Common situations: Running bootstrap in GitHub Actions or Docker builds where the secret was never provisioned; SSH non-interactive shells; forgetting to pre-populate the secret value via env or a store before non-interactive use.
Related errors
- bootstrap secret ' ' has invalid environment variable name
- cannot publish: encrypted path
- conflicting bootstrap secret declarations for
- expected y/yes or n/no, got
- invalid bootstrap secret name
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/f8409abc4f6cfe49.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/secrets.rs:467
.next()
.is_some_and(|first| first == '_' || first.is_ascii_alphabetic())
&& characters.all(|character| character == '_' || character.is_ascii_alphanumeric())
}
fn env_state(declaration: &SecretDeclaration) -> SecretState {
match std::env::var_os(&declaration.env) {
None => SecretState::Missing,
Some(value) => match value.into_string() {
Err(_) => SecretState::InvalidUnicode,
Ok(value) if value.is_empty() && !declaration.allow_empty => SecretState::Empty,
Ok(_) => SecretState::Available,
},
}
}
fn prompt_value(declaration: &SecretDeclaration) -> Result<String> {
if !console::user_attended_stderr() {
bail!(
"cannot prompt for bootstrap secret '{}' without an interactive terminal",
declaration.name
);
}
let prompt = declaration
.description
.clone()
.unwrap_or_else(|| format!("Enter bootstrap secret {}", declaration.name));
Ok(Input::new(&prompt)
.password(true)
.theme(&crate::ui::theme::get_theme())
.run()?)
}
#[cfg(test)]
mod tests {
use super::*;
View on GitHub (pinned to 533346cc37)