{"record":{"id":"4ce2ab409ab2614d","repo":"bevyengine/bevy","slug":"schedulenotfound","errorCode":"ScheduleNotFound","errorMessage":"Schedule not found.","messagePattern":"Schedule not found\\.","errorType":"error_code","errorClass":"ScheduleError","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/schedule/error.rs","lineNumber":292,"sourceCode":"            }\n            ScheduleBuildWarning::Ambiguity(AmbiguousSystemConflictsWarning(ambiguities)) => {\n                ScheduleBuildError::ambiguity_to_string(ambiguities, graph, world.components())\n            }\n        }\n    }\n}\n\n/// Error returned from some `Schedule` methods\n#[derive(Error, Debug)]\npub enum ScheduleError {\n    /// Operation cannot be completed because the schedule has changed and `Schedule::initialize` needs to be called\n    #[error(\"Operation cannot be completed because the schedule has changed and `Schedule::initialize` needs to be called\")]\n    Uninitialized,\n    /// Method could not find set\n    #[error(\"Set not found\")]\n    SetNotFound,\n    /// Schedule not found\n    #[error(\"Schedule not found.\")]\n    ScheduleNotFound,\n    /// Error initializing schedule\n    #[error(\"{0}\")]\n    ScheduleBuildError(ScheduleBuildError),\n}\n\nimpl From<ScheduleBuildError> for ScheduleError {\n    fn from(value: ScheduleBuildError) -> Self {\n        Self::ScheduleBuildError(value)\n    }\n}\n","sourceCodeStart":274,"sourceCodeEnd":304,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/schedule/error.rs#L274-L304","documentation":"`ScheduleError::ScheduleNotFound` is returned by `Schedules::remove_systems_in_set` (and sibling `Schedules` methods) when `get_mut(schedule)` finds no schedule under that label — the schedule was never created via `add_systems`/`entry` for that `ScheduleLabel`. It is the schedules-collection level of 'key not present', distinct from `SetNotFound` which is set-level within an existing schedule.","triggerScenarios":"Calling `schedules.remove_systems_in_set(MyLabel, set, ...)` when no schedule exists under `MyLabel`; using a different (or custom) label type than the one the systems were added under; removing before the plugin that creates the schedule has built it.","commonSituations":"Two `ScheduleLabel` types with similar names (e.g. a custom `Update`-like label vs `Update`); plugin ordering where removal runs before creation; cleanup code in tests assuming a schedule exists.","solutions":["Create/populate the schedule first: `schedules.add_systems(Label, ...)` or use `.entry(Label)` which inserts on demand","Double-check the exact label type and that the plugin owning the schedule was added before your call","Handle the `Err` gracefully in optional-cleanup paths instead of unwrapping"],"exampleFix":"// before\nlet n = schedules.remove_systems_in_set(MyLabel, MySet, &mut world, policy)?; // ScheduleNotFound\n\n// after\nschedules.entry(MyLabel).add_systems(dummy_placeholder_free_marker); // ensure schedule exists\n// or simply verify first:\nif schedules.get_mut(MyLabel).is_some() { /* ... proceed ... */ }","handlingStrategy":"try-catch","validationCode":"// Check the schedule exists before operating on it\nif schedules.get_mut(MyLabel).is_some() {\n    schedules.remove_systems_in_set(MyLabel, MySet, &mut world, policy)?;\n}\n// or create on demand: schedules.entry(MyLabel);","typeGuard":null,"tryCatchPattern":"match schedules.remove_systems_in_set(MyLabel, MySet, &mut world, policy) {\n    Err(ScheduleError::ScheduleNotFound) => Ok(0), // nothing to clean\n    other => other,\n}","preventionTips":["Use .entry(label) when you want create-if-missing semantics on the Schedules collection","Confirm label types (custom labels vs built-ins like Update) before removal calls","Order plugin builds so schedule-creating plugins run before schedule-consuming cleanup"],"tags":["bevy","ecs","schedule","schedule-label","not-found"],"backgroundTag":"schedule-not-registered","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}