{"record":{"id":"9fe95247337cd4b1","repo":"bevyengine/bevy","slug":"access-is-unbounded","errorCode":null,"errorMessage":"Access is unbounded","messagePattern":"Access is unbounded","errorType":"exception","errorClass":"UnboundedAccessError","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/query/access.rs","lineNumber":559,"sourceCode":"                ComponentAccessKind::Exclusive(index)\n            } else {\n                ComponentAccessKind::Shared(index)\n            }\n        });\n\n        let archetypal = self\n            .archetypal\n            .difference(reads)\n            .map(ComponentAccessKind::Archetypal);\n\n        Ok(accesses.chain(archetypal))\n    }\n}\n\n/// Error returned when attempting to iterate over items included in an [`Access`]\n/// if the access excludes items rather than including them.\n#[derive(Clone, Copy, PartialEq, Eq, Debug, Error)]\n#[error(\"Access is unbounded\")]\npub struct UnboundedAccessError {\n    /// [`Access`] is defined in terms of _excluding_ [exclusive](ComponentAccessKind::Exclusive)\n    /// access.\n    pub writes_inverted: bool,\n    /// [`Access`] is defined in terms of _excluding_ [shared](ComponentAccessKind::Shared) and\n    /// [exclusive](ComponentAccessKind::Exclusive) access.\n    pub reads_inverted: bool,\n}\n\n/// Describes the level of access for a particular component as defined in an [`Access`].\n#[derive(PartialEq, Eq, Hash, Debug, Clone, Copy)]\npub enum ComponentAccessKind {\n    /// Archetypical access, such as `Has<Foo>`.\n    Archetypal(ComponentId),\n    /// Shared access, such as `&Foo`.\n    Shared(ComponentId),\n    /// Exclusive access, such as `&mut Foo`.\n    Exclusive(ComponentId),","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/query/access.rs#L541-L577","documentation":"Error from UnboundedAccessError: an operation tried to enumerate/iterate the items included in an Access, but the Access is unbounded — it grants access to all components (e.g. via a broad &mut EntityMut or resource access), so there is no finite item set to iterate. The error type is the sentinel returned by such conversion/iteration attempts.","triggerScenarios":"Thrown at crates/bevy_ecs/src/query/access.rs:559 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Narrow the access: query specific components instead of unbounded EntityMut access","Check Access::is_unbounded() before attempting to iterate its contents","Design the consumer to handle the unbounded case (error/skip) rather than assume enumeration is possible"],"exampleFix":null,"handlingStrategy":"type-guard","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-14T05:17:10.506Z"}