{"record":{"id":"451eab9b3c61bfa2","repo":"warpdotdev/warp","slug":"environment-not-found","errorCode":null,"errorMessage":"Environment {} not found","messagePattern":"Environment (.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/environment.rs","lineNumber":278,"sourceCode":"            .initial_load_complete()\n            .with_timeout(WARP_DRIVE_SYNC_TIMEOUT);\n\n        ctx.spawn(initial_sync, move |_, result, ctx| {\n            if result.is_err() {\n                super::report_fatal_error(\n                    anyhow::anyhow!(\"Timed out waiting for Warp Drive to sync\"),\n                    ctx,\n                );\n                return;\n            }\n\n            // Get the ServerId and check if the environment exists\n            let server_id = match ServerId::try_from(id.as_str()) {\n                Ok(sid) => sid,\n                Err(_) => {\n                    ctx.terminate_app(\n                        warpui::platform::TerminationMode::ForceTerminate,\n                        Some(Err(anyhow::anyhow!(\"Environment {} not found\", id))),\n                    );\n                    return;\n                }\n            };\n            let sync_id = SyncId::ServerId(server_id);\n            let environment = CloudAmbientAgentEnvironment::get_by_id(&sync_id, ctx);\n\n            if let Some(environment) = environment {\n                Self::print_environment_details(&environment.model().string_model);\n                ctx.terminate_app(warpui::platform::TerminationMode::ForceTerminate, None);\n            } else {\n                ctx.terminate_app(\n                    warpui::platform::TerminationMode::ForceTerminate,\n                    Some(Err(anyhow::anyhow!(\"Environment {} not found\", id))),\n                );\n            }\n        });\n    }","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/environment.rs#L260-L296","documentation":"Thrown on the `warp environment get <id>` path when ServerId::try_from(id.as_str()) fails, i.e. the argument is not syntactically a valid ServerId. The code treats an unparseable ID as equivalent to 'not found' and force-terminates with 'Environment {id} not found'. Note this happens after the Warp Drive sync gate, and before any object lookup.","triggerScenarios":"Passing an environment name instead of its server ID, a truncated/corrupted ID from copy-paste, an ID with surrounding whitespace or a newline, or a ClientId-based ('Unsynced') identifier that is not a ServerId.","commonSituations":"Users assume `get` accepts the environment name shown in `list` output; scripts copy the display ID but mangle it; shell variable expansion adds whitespace; the environment was created locally and never synced so only a ClientId exists.","solutions":["Run `warp environment list` and copy the exact id column value (the ServerId string)","Check the argument for stray whitespace, quotes, or newline before passing it","If the environment shows 'Unsynced' in list output, wait for it to sync — a ClientId is not accepted by get","Quote the ID in shell to prevent expansion issues"],"exampleFix":"# before\nwarp environment get \"my-dev-env \"\n\n# after\nwarp environment list   # copy the real id, e.g. 0192abc4-...\nwarp environment get 0192abc4-7def-7000-8000-1c2d3e4f5a6b","handlingStrategy":"validation","validationCode":"// Rust: parse-check before invoking get\nuse crate::server::ids::ServerId;\nfn is_valid_environment_id(id: &str) -> bool {\n    ServerId::try_from(id).is_ok()\n}","typeGuard":"fn is_server_id(id: &str) -> bool {\n    ServerId::try_from(id.trim()).is_ok()\n}","tryCatchPattern":"match ServerId::try_from(id.as_str()) {\n    Ok(sid) => { /* proceed with SyncId::ServerId(sid) */ },\n    Err(_) => { /* suggest `warp environment list` to fetch the real ID */ },\n}","preventionTips":["Always copy the id column from `warp environment list`, never the name","Trim whitespace/newlines from IDs pasted into scripts","Remember `get` accepts only synced ServerIds — 'Unsynced' entries cannot be fetched","Quote IDs in shell to avoid glob/word-splitting"],"tags":["rust","cli","validation","id-parsing","copy-paste"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}