{"record":{"id":"6a54045a73c62e14","repo":"spacedriveapp/spacedrive","slug":"failed-to-open-window","errorCode":null,"errorMessage":"Failed to open window","messagePattern":"Failed to open window","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/gpui-photo-grid/src/main.rs","lineNumber":68,"sourceCode":"                    show: true,\n                    kind: WindowKind::Normal,\n                    is_movable: true,\n                    display_id: None,\n                    ..Default::default()\n                },\n                |_, cx| {\n                    cx.new(|cx| {\n                        PhotoGridView::new(\n                            socket_addr,\n                            http_url,\n                            library_id,\n                            initial_path,\n                            cx,\n                        )\n                    })\n                },\n            )\n            .expect(\"Failed to open window\");\n        });\n}\n","sourceCodeStart":50,"sourceCodeEnd":71,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/gpui-photo-grid/src/main.rs#L50-L71","documentation":"cx.open_window creates the OS window through GPUI and returns Err on failure; the expect panics. Window creation fails when there is no display connection, GPU surface creation fails, or the compositor rejects the window options.","triggerScenarios":"Running over SSH without X11/Wayland forwarding (DISPLAY/WAYLAND_DISPLAY unset); headless CI boxes; Wayland compositors that reject the window configuration; GPU drivers missing EGL/Vulkan support.","commonSituations":"cargo run on a remote dev box with no display; misconfigured WSLg or older X servers; driver-less VMs.","solutions":["Ensure DISPLAY or WAYLAND_DISPLAY points at a reachable compositor session","Run on the machine's local graphical session, not a headless SSH one","On Linux, verify the GPU stack works for other accelerated apps (glxinfo -B, EGL demos)","For CI/automation, run under Xvfb or mark the app as requiring a display"],"exampleFix":"// before: expect loses the failure reason\ncx.open_window(opts, build).expect(\"Failed to open window\");\n\n// after: exit with the underlying error\nmatch cx.open_window(opts, build) {\n    Ok(_) => {}\n    Err(e) => {\n        eprintln!(\"Failed to open window: {e}. Is a display/GPU available?\");\n        std::process::exit(1);\n    }\n}","handlingStrategy":"validation","validationCode":"// Before creating the window, confirm a display is reachable\n#[cfg(target_os = \"linux\")]\nif std::env::var_os(\"DISPLAY\").is_none() && std::env::var_os(\"WAYLAND_DISPLAY\").is_none() {\n    eprintln!(\"No display found; set DISPLAY or WAYLAND_DISPLAY\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match cx.open_window(opts, build) {\n    Ok(handle) => handle,\n    Err(e) => {\n        eprintln!(\"Failed to open window: {e}\");\n        std::process::exit(1);\n    }\n}","preventionTips":["Run GPU apps in a local graphical session or via X11/Wayland forwarding","Gate automated runs on Xvfb in CI","Report the underlying GPUI error, never just 'failed to open window'"],"tags":["gpui","windowing","display","gpu","panic"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}