{"record":{"id":"b1dbeb0db3c14229","repo":"rust-lang/cargo","slug":"override-found-but-no-real-ones","errorCode":null,"errorMessage":"override found but no real ones","messagePattern":"override found but no real ones","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/workspace/registry.rs","lineNumber":756,"sourceCode":"            kind: QueryKind,\n            f: &mut dyn FnMut(IndexSummary),\n        ) -> CargoResult<()> {\n            source\n                .query(dep, kind, f)\n                .await\n                .with_context(|| format!(\"unable to update {}\", source.source_id()))\n                .with_context(|| {\n                    format!(\n                        \"failed to load source for dependency `{}`\",\n                        dep.package_name()\n                    )\n                })\n        }\n\n        let source = self.sources.borrow().get(dep.source_id()).cloned();\n        match (override_summary, source) {\n            (Some(_), None) => {\n                return Err(anyhow::anyhow!(\"override found but no real ones\"));\n            }\n            (None, None) => return Ok(()),\n\n            // If we don't have an override then we just ship everything upstairs after locking the summary\n            (None, Some(source)) => {\n                for patch in patches.iter() {\n                    f(IndexSummary::Candidate(patch.clone()));\n                }\n\n                // Our sources shouldn't ever come back to us with two summaries\n                // that have the same version. We could, however, have an `[patch]`\n                // section which is in use to override a version in the registry.\n                // This means that if our `summary` in this loop has the same\n                // version as something in `patches` that we've already selected,\n                // then we skip this `summary`.\n                let locked = &self.locked;\n                let all_patches = &self.patches_available;\n                let mode = if self.gctx.cli_unstable().prerelease {","sourceCodeStart":738,"sourceCodeEnd":774,"githubUrl":"https://github.com/rust-lang/cargo/blob/98a09e7e7d62850f14e5b6132101fc1edd19a16f/src/workspace/registry.rs#L738-L774","documentation":"An internal consistency error in the registry's lock/override logic: a path-override summary (`override_summary`) exists for a dependency, but the underlying source (`self.sources`) has no matching entry (`source` is `None`). This indicates the override references a source Cargo can no longer locate — typically a stale lock file or a removed/renamed override path.","triggerScenarios":"The `(Some(_), None)` arm at registry.rs:745-747 fires: an override summary was produced by `[replace]`/path override logic, but the source registry has no entry for `dep.source_id()`.","commonSituations":"A lock file referencing a path override whose directory was deleted or moved. Removing a `[replace]` section without regenerating the lock. Switching branches with divergent override configs.","solutions":["Run `cargo update` to regenerate the lock file against the current manifest.","Verify the override path still exists and is accessible.","Remove stale `[replace]` entries or path overrides from the manifest."],"exampleFix":"# before: lock file references a removed override\n# (run:) cargo update\n\n# after: lock file regenerated, override reconciled with current sources","handlingStrategy":"retry","validationCode":"// Verify override sources are present before resolving\nfn override_sources_exist(sources: &[&SourceId], registry: &SourceMap) -> bool {\n    sources.iter().all(|sid| registry.get(sid).is_some())\n}","typeGuard":null,"tryCatchPattern":"// if cargo fails with \"override found but no real ones\":\n//   1. cargo update  // regenerate lock\n//   2. if persists, delete Cargo.lock and cargo generate-lockfile","preventionTips":["Regenerate the lock file after removing or moving override paths.","Keep `[replace]`/override config and the lock file in sync.","Avoid switching branches with divergent override setups without `cargo update`."],"tags":["cargo","registry","override","lock-file","internal"],"backgroundTag":null,"analyzedSha":"98a09e7e7d62850f14e5b6132101fc1edd19a16f","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}