{"record":{"id":"9b521070fc933616","repo":"bevyengine/bevy","slug":"cached-system-was-not-found","errorCode":null,"errorMessage":"Cached system was not found","messagePattern":"Cached system was not found","errorType":"exception","errorClass":"RegisteredSystemError","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/system/system_registry.rs","lineNumber":850,"sourceCode":"        S: IntoSystem<I, O, M> + 'static,\n    {\n        let id = self.register_system_cached(system);\n        self.run_system_with(id, input)\n    }\n}\n\n/// An operation with stored systems failed.\n#[derive(Error)]\npub enum RegisteredSystemError<I: SystemInput = (), O = ()> {\n    /// A system was run by id, but no system with that id was found.\n    ///\n    /// Did you forget to register it?\n    #[error(\"System {0:?} was not registered\")]\n    SystemIdNotRegistered(SystemId<I, O>),\n    /// A cached system was removed by value, but no system with its type was found.\n    ///\n    /// Did you forget to register it?\n    #[error(\"Cached system was not found\")]\n    SystemNotCached,\n    /// The `RegisteredSystem` component is missing.\n    #[error(\"System {0:?} does not have a RegisteredSystem component. This only happens if app code removed the component.\")]\n    MissingRegisteredSystemComponent(SystemId<I, O>),\n    /// A system tried to remove itself.\n    #[error(\"System {0:?} tried to remove itself\")]\n    SelfRemove(SystemId<I, O>),\n    /// System could not be run due to parameters that failed validation.\n    /// This is not considered an error.\n    #[error(\"System did not run due to failed parameter validation: {0}\")]\n    Skipped(SystemParamValidationError),\n    /// System returned an error or failed required parameter validation.\n    #[error(\"System returned error: {0}\")]\n    Failed(BevyError),\n    /// [`SystemId`] had different input and/or output types than [`SystemIdMarker`]\n    #[error(\"Could not get system from `{}`, entity was `SystemId<{}, {}>`\", DebugName::type_name::<SystemId<I, O>>(), .1.input_type_id.name, .1.output_type_id.name)]\n    IncorrectType(SystemId<I, O>, SystemIdMarker),\n    /// System is not present in the `RegisteredSystem` component.","sourceCodeStart":832,"sourceCodeEnd":868,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/system/system_registry.rs#L832-L868","documentation":"RegisteredSystemError::SystemNotCached: remove_system_cached was called to remove a cached system by value, but no cached system of that type was found in the registry.","triggerScenarios":"Thrown at crates/bevy_ecs/src/system/system_registry.rs:850 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the system was registered via register_system_cached before calling remove_system_cached","Pass the exact same system value/type that was cached","Match on the error variant and treat removal of a non-cached system as a no-op"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}