{"record":{"id":"1d24e6b44e712dc7","repo":"LGUG2Z/komorebi","slug":"could-not-load-configuration-1d24e6","errorCode":null,"errorMessage":"could not load configuration","messagePattern":"could not load configuration","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"komorebi/src/window_manager.rs","lineNumber":340,"sourceCode":"            if let Err(error) = self.update_focused_workspace(true, true) {\n                tracing::warn!(\n                    \"cannot update focused workspace '{focused_workspace_idx}' on monitor '{focused_monitor_idx}' from {}: {}\",\n                    temp_dir().join(\"komorebi.state.json\").to_string_lossy(),\n                    error,\n                );\n            }\n        } else {\n            tracing::warn!(\n                \"cannot apply state from {}; some windows referenced in the state file no longer exist\",\n                temp_dir().join(\"komorebi.state.json\").to_string_lossy()\n            );\n        }\n    }\n\n    #[tracing::instrument]\n    pub fn reload_configuration() {\n        tracing::info!(\"reloading configuration\");\n        std::thread::spawn(|| load_configuration().expect(\"could not load configuration\"));\n    }\n\n    #[tracing::instrument(skip(self))]\n    pub fn reload_static_configuration(&mut self, pathbuf: &PathBuf) -> eyre::Result<()> {\n        tracing::info!(\"reloading static configuration\");\n        StaticConfig::reload(pathbuf, self)\n    }\n\n    pub fn window_management_behaviour(\n        &self,\n        monitor_idx: usize,\n        workspace_idx: usize,\n    ) -> WindowManagementBehaviour {\n        if let Some(monitor) = self.monitors().get(monitor_idx)\n            && let Some(workspace) = monitor.workspaces().get(workspace_idx)\n        {\n            let current_behaviour = if let Some(behaviour) = workspace.window_container_behaviour {\n                if workspace.containers().is_empty()","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebi/src/window_manager.rs#L322-L358","documentation":"reload_configuration spawns a thread running load_configuration().expect(...); any Err while parsing/loading the user's komorebi.json panics that thread with 'could not load configuration'. Because it runs in a background thread, the panic kills only that thread but the intended config reload silently never happens.","triggerScenarios":"Calling WindowManager::reload_configuration (or triggering a manual reload) while komorebi.json is missing, unreadable, or contains schema-invalid JSON.","commonSituations":"Saving a hand-edited komorebi.json with a JSON syntax error or an invalid enum value; config file moved/renamed; KOMOREBI_CONFIG_HOME changed after startup.","solutions":["Validate komorebi.json (jq . / JSON schema) and fix syntax or schema errors","Restore the config file if it was moved or deleted from KOMOREBI_CONFIG_HOME","Check komorebi logs (komorebi.log) for the underlying parse error description","Swap the expect for logged error handling so a bad reload doesn't abort the watcher"],"exampleFix":"// before\nstd::thread::spawn(|| load_configuration().expect(\"could not load configuration\"));\n// after\nstd::thread::spawn(|| {\n    if let Err(e) = load_configuration() {\n        tracing::error!(\"could not load configuration: {e}\");\n    }\n});","handlingStrategy":"validation","validationCode":"let text = std::fs::read_to_string(\"~/.config/komorebi/komorebi.json\")?;\nlet _: serde_json::Value = serde_json::from_str(&text)?; // fails fast on bad JSON","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint komorebi.json before triggering a manual reload","Keep a known-good backup of the config to restore quickly","Check komorebi.log for the underlying parse error after a failed reload"],"tags":["config","json","panic","reload"],"backgroundTag":"invalid-config-value","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}