{"record":{"id":"285d8d3f99d8214c","repo":"jdx/mise","slug":"deps-provider-depends-on-unknown-provider","errorCode":null,"errorMessage":"deps provider '{}' depends on unknown provider '{}'","messagePattern":"deps provider '(.+?)' depends on unknown provider '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/deps/deps_ordering.rs","lineNumber":23,"sourceCode":"\n/// Manages a dependency graph of deps providers for execution scheduling.\n/// Thin wrapper around `DepsGraph<String, String>` with deps-specific\n/// validation and error messages.\n#[derive(Debug)]\npub(crate) struct DepsOrdering {\n    inner: DepsGraph<String, String>,\n}\n\nimpl DepsOrdering {\n    /// Creates a new DepsOrdering from a list of (provider_id, depends) tuples.\n    pub(crate) fn new(providers: &[(String, Vec<String>)]) -> Result<Self> {\n        // Validate that all deps reference known providers before building the graph\n        let known: std::collections::HashSet<&str> =\n            providers.iter().map(|(id, _)| id.as_str()).collect();\n        for (id, deps) in providers {\n            for dep in deps {\n                if !known.contains(dep.as_str()) {\n                    bail!(\n                        \"deps provider '{}' depends on unknown provider '{}'\",\n                        id,\n                        dep\n                    );\n                }\n            }\n        }\n\n        let nodes: Vec<(String, String)> = providers\n            .iter()\n            .map(|(id, _)| (id.clone(), id.clone()))\n            .collect();\n\n        let edges: Vec<(String, String)> = providers\n            .iter()\n            .flat_map(|(id, deps)| deps.iter().map(move |dep| (id.clone(), dep.clone())))\n            .collect();\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/deps/deps_ordering.rs#L5-L41","documentation":"DepsOrdering builds a scheduling graph over deps providers. Before constructing the graph it validates that every dependency name in each provider's deps list refers to a provider id that actually exists in the supplied set. If a provider lists a dependency that was never registered, construction fails immediately rather than producing a graph with dangling edges. This is an internal wiring/registration problem, not a runtime task failure.","triggerScenarios":"Calling DepsOrdering::new(providers) where for some (id, deps) tuple, deps contains a string not present among the provider ids in the same list — e.g. provider \"env\" declares deps = [\"tools\"] but no \"tools\" provider was passed.","commonSituations":"A provider was renamed or removed without updating dependents' deps lists; a typo in a deps entry; a provider conditionally registered (e.g. disabled by settings) while another still depends on it.","solutions":["Fix the deps list so it references only registered provider ids — check spelling against the actual provider ids.","Register the missing provider (or re-enable the setting that includes it) before constructing DepsOrdering.","Update dependents when a provider is renamed/removed so no stale dependency names remain.","Add a debug log/dump of the providers list to confirm which id/dep pair triggers the mismatch."],"exampleFix":"// before\nproviders = [(\"env\", [\"toolz\"])]  // typo, \"toolz\" not registered\n\n// after\nproviders = [(\"env\", [\"tools\"]), (\"tools\", [])]","handlingStrategy":"validation","validationCode":"# Validate all deps reference registered provider ids before building the graph\nids=$(printf '%s\\n' \"$@\" | cut -d: -f1);  # provider ids\n# in code: ensure deps ⊆ ids before DepsOrdering::new\nassert deps.iter().all(|d| ids.contains(d)), \"unknown provider in deps\"","typeGuard":"fn deps_known(providers: &[(String, Vec<String>)]) -> bool {\n    let known: std::collections::HashSet<&str> = providers.iter().map(|(id, _)| id.as_str()).collect();\n    providers.iter().all(|(_, deps)| deps.iter().all(|d| known.contains(d.as_str())))\n}","tryCatchPattern":"match DepsOrdering::new(&providers) {\n    Err(e) if e.to_string().contains(\"unknown provider\") => {\n        eprintln!(\"wiring bug: fix the deps list to reference registered providers\");\n    }\n    other => other?,\n}","preventionTips":["Keep provider registration and deps lists in one module so renames update both","Grep for renamed/removed provider ids when editing deps lists","Note that conditionally-disabled providers must also be removed from dependents' deps"],"tags":["deps","dependency-graph","internal"],"backgroundTag":"missing-dependency","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"}