{"id":"17fc558a0d9afc28","repo":"rust-lang/cargo","slug":"parent-not-currently-active","errorCode":null,"errorMessage":"parent not currently active!?","messagePattern":"parent not currently active!\\?","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/resolver/mod.rs","lineNumber":842,"sourceCode":"            .map(|&c| cx.is_active(c).map(|a| (a, c))),\n    )?;\n    let backtrack_critical_reason: ConflictReason =\n        conflicting_activations[&backtrack_critical_id].clone();\n\n    if cx\n        .parents\n        .is_path_from_to(&parent.package_id(), &backtrack_critical_id)\n    {\n        // We are a descendant of the trigger of the problem.\n        // The best generalization of this is to let things bubble up\n        // and let `backtrack_critical_id` figure this out.\n        return None;\n    }\n    // What parents does that critical activation have\n    for (critical_parent, critical_parents_deps) in\n        cx.parents.edges(&backtrack_critical_id).filter(|(p, _)| {\n            // it will only help backjump further if it is older then the critical_age\n            cx.is_active(**p).expect(\"parent not currently active!?\") < backtrack_critical_age\n        })\n    {\n        for critical_parents_dep in critical_parents_deps.iter() {\n            // We only want `first_version.is_some()` for direct dependencies of workspace\n            // members which isn't the case here as this has a `parent`\n            let first_version = None;\n            // A dep is equivalent to one of the things it can resolve to.\n            // Thus, if all the things it can resolve to have already ben determined\n            // to be conflicting, then we can just say that we conflict with the parent.\n            if let Some(others) = registry\n                .query(critical_parents_dep, first_version)\n                .expect(\"an already used dep now pending!?\")\n                .expect(\"an already used dep now error!?\")\n                .iter()\n                .rev() // the last one to be tried is the least likely to be in the cache, so start with that.\n                .map(|other| {\n                    past_conflicting_activations\n                        .find(","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/resolver/mod.rs#L824-L860","documentation":"Invariant in the dependency resolver's conflict-resolution (`find_candidate`): when iterating parents of the critical (conflicting) activation, it calls `cx.is_active(**p).expect(\"parent not currently active!?\")`. The resolver assumes any parent recorded in the `parents` graph of an active node is itself active.","triggerScenarios":"Fires if the resolver's context graph has a parent edge to a node that `is_active` reports as inactive — i.e. the `parents` graph and the active-set have diverged. This is a deep resolver-internal consistency bug, typically introduced by a backtracking/state-restoration regression.","commonSituations":"Almost exclusively a cargo resolver bug; surfaced on complex dependency graphs with heavy backtracking (large workspaces, conflicting `links`, version conflicts). End-user config rarely causes it; a particular `Cargo.lock`/graph may reproducibly trip it.","solutions":["Report a cargo bug with the minimal `Cargo.toml`/`Cargo.lock` that reproduces the panic.","Try the alternate resolver (`resolver = \"2\"` or `= \"1\"`) in the root manifest to dodge the buggy path.","Pin or relax specific dependency versions to change the backtracking shape and avoid the trigger.","Update cargo — resolver invariants are fixed promptly."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// No caller-side pre-check; mitigate by changing resolver behavior.\n// In Cargo.toml root:\n// [package]\n// resolver = \"2\"   # or \"1\" to avoid the buggy backtracking path","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin cargo to a stable toolchain in CI via `rust-toolchain.toml`.","Minimize conflicting version constraints and `[patch]` complexity to reduce backtracking.","Report reproducer graphs upstream promptly."],"tags":["cargo","panic","invariant","resolver","backtracking","conflict-cache","rust"],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}