{"record":{"id":"f04d178970d791eb","repo":"astrid-runtime/astrid","slug":"astrid-init-requires-distro-owner-repo-url-l","errorCode":null,"errorMessage":"astrid init requires --distro <@owner/repo, URL, local Distro.toml, or .shuttle> unless ASTRID_ENFORCED_DISTRO is set by an embedding launcher; Astrid Runtime does not choose a product distro","messagePattern":"astrid init requires --distro <@owner/repo, URL, local Distro\\.toml, or \\.shuttle> unless ASTRID_ENFORCED_DISTRO is set by an embedding launcher; Astrid Runtime does not choose a product distro","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/dispatch.rs","lineNumber":271,"sourceCode":"        Some(Commands::Update(args)) => {\n            commands::self_update::run_self_update(args).await?;\n            Ok(ExitCode::SUCCESS)\n        },\n        Some(Commands::External(tokens)) => dispatch_root_shorthand(tokens).await,\n    }\n}\n\nfn resolve_init_distro(requested: Option<String>) -> Result<String> {\n    resolve_init_distro_with(requested, std::env::var_os(\"ASTRID_ENFORCED_DISTRO\"))\n}\n\nfn resolve_init_distro_with(\n    requested: Option<String>,\n    enforced: Option<OsString>,\n) -> Result<String> {\n    let Some(enforced) = enforced else {\n        return non_empty_distro_source(requested).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"astrid init requires --distro <@owner/repo, URL, local Distro.toml, or .shuttle> unless ASTRID_ENFORCED_DISTRO is set by an embedding launcher; Astrid Runtime does not choose a product distro\"\n            )\n        });\n    };\n    let enforced = enforced.into_string().map_err(|_| {\n        anyhow::anyhow!(\"ASTRID_ENFORCED_DISTRO must contain a valid UTF-8 distro source\")\n    })?;\n    if enforced.is_empty() {\n        anyhow::bail!(\"ASTRID_ENFORCED_DISTRO must not be empty\");\n    }\n    if requested.is_some() {\n        anyhow::bail!(\n            \"astrid init cannot override the operator-enforced distro in ASTRID_ENFORCED_DISTRO\"\n        );\n    }\n    Ok(enforced)\n}\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/dispatch.rs#L253-L289","documentation":"`astrid init` was run without a --distro source while the ASTRID_ENFORCED_DISTRO environment variable was unset. Astrid deliberately has no default product distro: the user must supply one of @owner/repo, a URL, a local Distro.toml, or a .shuttle directory, unless an embedding launcher enforces one via the env var.","triggerScenarios":"resolve_init_distro_with called with requested=None and enforced=None; i.e. `astrid init` with no --distro flag and no ASTRID_ENFORCED_DISTRO in the environment.","commonSituations":"New users running bare `astrid init` expecting a default; CI scripts dropping the --distro flag; embedding launchers that forgot to set ASTRID_ENFORCED_DISTRO.","solutions":["Pass --distro with a valid source: @owner/repo, URL, path to Distro.toml, or .shuttle","If embedding, set ASTRID_ENFORCED_DISTRO before invoking the CLI","Check that the flag isn't being dropped by a wrapper script","Consult the distro documentation to pick a distro source"],"exampleFix":"// before\nastrid init\n// after\nastrid init --distro @owner/repo","handlingStrategy":"try-catch","validationCode":"if std::env::var_os(\"ASTRID_ENFORCED_DISTRO\").is_none() && !args.contains(\"--distro\") {\n    eprintln!(\"astrid init needs --distro or ASTRID_ENFORCED_DISTRO\");\n}","typeGuard":null,"tryCatchPattern":"match astrid_init(distro) {\n    Err(e) if e.to_string().starts_with(\"astrid init requires --distro\") => {\n        eprintln!(\"supply --distro @owner/repo, URL, Distro.toml, or .shuttle\");\n    }\n    other => other?,\n}","preventionTips":["Always pass --distro explicitly in scripts/CI","Set ASTRID_ENFORCED_DISTRO in embedding launchers","Don't assume a default distro exists"],"tags":["cli","distro","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}