{"record":{"id":"f8409abc4f6cfe49","repo":"jdx/mise","slug":"cannot-prompt-for-bootstrap-secret-without-an","errorCode":null,"errorMessage":"cannot prompt for bootstrap secret '{}' without an interactive terminal","messagePattern":"cannot prompt for bootstrap secret '(.+?)' without an interactive terminal","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/secrets.rs","lineNumber":467,"sourceCode":"        .next()\n        .is_some_and(|first| first == '_' || first.is_ascii_alphabetic())\n        && characters.all(|character| character == '_' || character.is_ascii_alphanumeric())\n}\n\nfn env_state(declaration: &SecretDeclaration) -> SecretState {\n    match std::env::var_os(&declaration.env) {\n        None => SecretState::Missing,\n        Some(value) => match value.into_string() {\n            Err(_) => SecretState::InvalidUnicode,\n            Ok(value) if value.is_empty() && !declaration.allow_empty => SecretState::Empty,\n            Ok(_) => SecretState::Available,\n        },\n    }\n}\n\nfn prompt_value(declaration: &SecretDeclaration) -> Result<String> {\n    if !console::user_attended_stderr() {\n        bail!(\n            \"cannot prompt for bootstrap secret '{}' without an interactive terminal\",\n            declaration.name\n        );\n    }\n    let prompt = declaration\n        .description\n        .clone()\n        .unwrap_or_else(|| format!(\"Enter bootstrap secret {}\", declaration.name));\n    Ok(Input::new(&prompt)\n        .password(true)\n        .theme(&crate::ui::theme::get_theme())\n        .run()?)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/secrets.rs#L449-L485","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (CI)\n- run: mise bootstrap apply\n// after\n- run: mise bootstrap apply\n  env:\n    DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}","handlingStrategy":"fallback","validationCode":"// ensure the value is available before running non-interactively\nif std::env::var(\"DEPLOY_TOKEN\").is_err() && !is_interactive() {\n    panic!(\"DEPLOY_TOKEN must be provided for non-interactive bootstrap\");\n}","typeGuard":"fn can_prompt() -> bool {\n    console::user_attended_stderr()\n}","tryCatchPattern":"match bootstrap::apply(opts) {\n    Err(e) if e.to_string().contains(\"without an interactive terminal\") => {\n        eprintln!(\"set the secret env var or run interactively: {}\");\n        std::process::exit(2);\n    }\n    other => other?,\n}","preventionTips":["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"],"tags":["secrets","interactive-terminal","ci","prompt"],"backgroundTag":"authentication-required","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}