{"record":{"id":"aee15d5858d4a51f","repo":"jdx/mise","slug":"lockfile-attributed-to-unknown-workspace-proj","errorCode":null,"errorMessage":"lockfile {:?} attributed to unknown workspace project {id:?}","messagePattern":"lockfile (.+?) attributed to unknown workspace project (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace.rs","lineNumber":904,"sourceCode":"                        .or_default()\n                        .insert(AffectedProjectReason::ChangedPath { path: path.clone() });\n                }\n            }\n        } else {\n            for id in self.projects.keys() {\n                projects.entry(id.clone()).or_default().extend(\n                    global_paths\n                        .iter()\n                        .cloned()\n                        .map(|path| AffectedProjectReason::GlobalPath { path }),\n                );\n            }\n        }\n\n        for (path, ids) in lockfile_projects {\n            for id in ids {\n                if !self.projects.contains_key(id) {\n                    bail!(\n                        \"lockfile {:?} attributed to unknown workspace project {id:?}\",\n                        path\n                    );\n                }\n                projects\n                    .entry(id.clone())\n                    .or_default()\n                    .insert(AffectedProjectReason::Lockfile { path: path.clone() });\n            }\n        }\n\n        let mut dependents = BTreeMap::<ProjectId, BTreeSet<ProjectId>>::new();\n        for project in self.projects() {\n            for dependency in &project.dependencies {\n                dependents\n                    .entry(dependency.clone())\n                    .or_default()\n                    .insert(project.id.clone());","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/workspace.rs#L886-L922","documentation":"Lockfile-to-project attribution builds a map of which workspace project IDs each lockfile belongs to; every attributed ID must exist in the workspace. This error fires when a provider (or heuristic) maps a lockfile to a project ID the workspace does not know, so the lockfile cannot be assigned safely.","triggerScenarios":"A provider reports a lockfile whose recorded project ID is absent from the discovered project set — e.g. the project was removed/renamed but its lockfile remains, or the provider invents IDs not matching discovery.","commonSituations":"Deleted project directory with leftover package-lock.json / Cargo.lock still being scanned; a renamed project where the provider maps the lockfile by old name; config edited between discovery and lockfile scan.","solutions":["Delete the orphaned lockfile or restore the project it belonged to","Re-run workspace discovery so project IDs are current","Fix the provider's lockfile attribution to only emit IDs from its own discovered project list"],"exampleFix":"// before\nids = [format!(\"{}:{}\", self.id(), remembered_name)];\n// after\nids = discovered.iter().filter(|p| p.root == lockfile_dir).map(|p| p.id.clone()).collect();","handlingStrategy":"validation","validationCode":"for (path, ids) in &lockfile_projects {\n    for id in ids {\n        if !workspace.projects.contains_key(id) {\n            eprintln!(\"skipping {path:?}: unknown project {id}\");\n        }\n    }\n}","typeGuard":"fn is_known_project<'a>(ws: &Workspace, id: &'a str) -> bool { ws.projects.contains_key(id) }","tryCatchPattern":"match workspace.attribute_lockfiles(lockfile_projects) {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"attributed to unknown workspace project\") => {\n        eprintln!(\"stale lockfile or removed project; rediscover and retry\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Clean up lockfiles when removing a project directory","Rediscover projects before lockfile attribution after any config change","Have providers attribute lockfiles only to projects they themselves discovered"],"tags":["workspace","lockfile","not-found"],"backgroundTag":"entity-not-found","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"}