{"record":{"id":"1752efd864bb30a6","repo":"warpdotdev/warp","slug":"error-selecting-image","errorCode":null,"errorMessage":"Error selecting image","messagePattern":"Error selecting image","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/environment.rs","lineNumber":382,"sourceCode":"                        \"No docker image provided, please select a base image.\\n\"\n                    );\n                    println!(\n                        \"All warpdotdev images contain Python and Node, in addition to language-specific tooling. For more info: {}\\n\",\n                        WARP_DEV_ENVIRONMENTS_REPO\n                    );\n\n                    let mut image_choices: Vec<String> =\n                        output.images.into_iter().map(|img| img.image).collect();\n                    image_choices.push(CUSTOM_IMAGE_OPTION.to_string());\n\n                    let selected_image = match Select::new(\"Select a base image:\", image_choices)\n                        .prompt()\n                    {\n                        Ok(image) => image,\n                        Err(err) => {\n                            if !Self::handle_inquire_error(err, ctx) {\n                                super::report_fatal_error(\n                                    anyhow::anyhow!(\"Error selecting image\"),\n                                    ctx,\n                                );\n                            }\n                            return;\n                        }\n                    };\n\n                    let final_image = if selected_image == CUSTOM_IMAGE_OPTION {\n                        match inquire::Text::new(\"Enter custom Docker image name:\").prompt() {\n                            Ok(custom) => custom,\n                            Err(err) => {\n                                if !Self::handle_inquire_error(err, ctx) {\n                                    super::report_fatal_error(\n                                        anyhow::anyhow!(\"Error entering custom image\"),\n                                        ctx,\n                                    );\n                                }\n                                return;","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/environment.rs#L364-L400","documentation":"Reported when the interactive Select::new(\"Select a base image:\", ...).prompt() during environment creation returns an InquireError that is NOT OperationCanceled or OperationInterrupted (those are handled gracefully by handle_inquire_error, which prints 'Environment creation canceled.' and exits cleanly). It means the prompt itself malfunctioned — typically an IO error because stdin/stdout is not an interactive TTY.","triggerScenarios":"Running `warp environment create` without --docker-image inside CI, a script, a pipe, an SSH session without TTY allocation, or any non-interactive context where the inquire crate cannot render the select menu or read key input.","commonSituations":"Automation/CI pipelines invoking the create command unattended; piping input into the CLI; running under a process supervisor; terminal emulator incompatibility; stdin redirected from /dev/null.","solutions":["Pass --docker-image <image> so the interactive prompt is skipped entirely (create only prompts when the flag is absent)","Run the command in an interactive TTY (e.g. ssh -t for remote sessions)","In scripts, detect [ -t 0 ] and require the --docker-image flag before calling create","For unattended flows, never rely on the image-selection prompt"],"exampleFix":"# before (CI, no TTY)\nwarp environment create --name dev --repo owner/repo\n\n# after (CI, no TTY)\nwarp environment create --name dev --repo owner/repo --docker-image warpdotdev/base:latest","handlingStrategy":"try-catch","validationCode":"# Shell: only attempt the interactive create when a TTY is present\n# [ -t 0 ] || { echo \"requires --docker-image in non-interactive mode\"; exit 2; }","typeGuard":"fn is_interactive() -> bool {\n    std::io::stdin().is_terminal() && std::io::stdout().is_terminal()\n}","tryCatchPattern":"match Select::new(\"Select a base image:\", choices).prompt() {\n    Ok(image) => image,\n    Err(InquireError::OperationCanceled | InquireError::OperationInterrupted) => { /* clean exit */ },\n    Err(err) => { /* IO/TTY failure: fall back to requiring --docker-image */ },\n}","preventionTips":["Never rely on interactive prompts in CI/scripts — pass --docker-image","Guard wrappers with a TTY check before invoking prompt-driven commands","Use ssh -t when running remotely over SSH","Handle OperationCanceled/Interrupted separately from genuine prompt IO errors"],"tags":["rust","cli","interactive-prompt","tty","inquire"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}