{"record":{"id":"74d727a3a3b205b2","repo":"bevyengine/bevy","slug":"camera-entity-wasn-t-synced-74d727","errorCode":null,"errorMessage":"Camera entity wasn't synced.","messagePattern":"Camera entity wasn't synced\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/bevy_solari/src/pathtracer/extract.rs","lineNumber":25,"sourceCode":"};\nuse bevy_render::{sync_world::RenderEntity, Extract};\nuse bevy_transform::components::GlobalTransform;\n\npub fn extract_pathtracer(\n    cameras_3d: Extract<\n        Query<(\n            RenderEntity,\n            &Camera,\n            Ref<GlobalTransform>,\n            Option<&Pathtracer>,\n        )>,\n    >,\n    mut commands: Commands,\n) {\n    for (entity, camera, global_transform, pathtracer) in &cameras_3d {\n        let mut entity_commands = commands\n            .get_entity(entity)\n            .expect(\"Camera entity wasn't synced.\");\n        if let Some(pathtracer) = pathtracer\n            && camera.is_active\n        {\n            let mut pathtracer = pathtracer.clone();\n            pathtracer.reset |= global_transform.is_changed();\n            entity_commands.insert(pathtracer);\n        } else {\n            entity_commands.remove::<(Pathtracer, PathtracerAccumulationTexture)>();\n        }\n    }\n}\n","sourceCodeStart":7,"sourceCodeEnd":37,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_solari/src/pathtracer/extract.rs#L7-L37","documentation":"extract_pathtracer (bevy_solari pathtracer/extract.rs:23-25) calls commands.get_entity(RenderEntity) and expects Some, relying on the invariant that every main-world camera has a synced render-world entity maintained by bevy_render's sync systems. The panic means the render entity was missing or already removed when Solari's pathtracer extract system ran — an internal sync failure, not a user API error.","triggerScenarios":"Despawning a camera (or invalidating its RenderEntity mapping) between world sync and the Solari extract system; custom render app schedules that reorder or skip SyncPlugin; plugins that mutate sync_world entities; mismatched Bevy crate versions in one dependency graph.","commonSituations":"Hot-despawning cameras while the Solari/pathtracer plugin is enabled; custom render pipelines added to the RenderApp that interfere with camera sync; nightlies or mixed versions where sync ordering changed.","solutions":["Despawn cameras via commands (applied at sync boundaries) instead of immediate world despawn mid-frame","Remove the Pathtracer component first and despawn the camera on a later frame","Check any custom extract system ordering relative to bevy_render's sync systems","Verify all bevy_* crates resolve to the same version (cargo tree), then update — if it persists, report to the Bevy repo with a minimal repro"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Despawn cameras through commands so removal happens at a sync boundary","Toggle camera.is_active instead of despawning when switching pathtracer on/off rapidly","Keep custom render-app systems from reordering around bevy_render's sync systems","Pin all bevy_* crates to one version in Cargo.toml"],"tags":["bevy","solari","pathtracer","camera","render-world","entity-sync","panic"],"backgroundTag":"render-entity-sync-failed","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}