{"record":{"id":"67b744e1933841b2","repo":"Hmbown/CodeWhale","slug":"could-not-release-root-config-policy-err-rollb","errorCode":null,"errorMessage":"could not release root config policy ({err}){rollback_note}","messagePattern":"could not release root config policy \\((.+?)\\)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/app.rs","lineNumber":2964,"sourceCode":"            settings.permission_posture = Some(posture);\n            if let Err(err) = transaction.save(&settings) {\n                return Ok(RootPostureOutcome::Failed(format!(\n                    \"could not save TUI posture ({err})\"\n                )));\n            }\n\n            if let Err(err) = crate::config_persistence::persist_unset_root_key(\n                active_config_path.as_deref(),\n                \"approval_policy\",\n            ) {\n                settings.permission_posture = previous;\n                let rollback_note = transaction\n                    .save(&settings)\n                    .err()\n                    .map(|rollback| format!(\"; settings rollback also failed: {rollback}\"))\n                    .unwrap_or_default();\n                return Ok(RootPostureOutcome::Failed(format!(\n                    \"could not release root config policy ({err}){rollback_note}\"\n                )));\n            }\n            Ok(RootPostureOutcome::Committed)\n        })\n        .unwrap_or_else(|err| {\n            RootPostureOutcome::Failed(format!(\"could not lock TUI settings ({err})\"))\n        });\n        if let RootPostureOutcome::Failed(reason) = outcome {\n            return Err(reason);\n        }\n\n        self.clear_saved_approval_policy_lock();\n        self.finish_approval_posture_change(next);\n        Ok(())\n    }\n\n    fn next_approval_posture(&mut self, allow_root_policy: bool) -> Option<ApprovalMode> {\n        if self.reject_setting_change_while_busy(MessageId::SettingSubjectPermissions) {","sourceCodeStart":2946,"sourceCodeEnd":2982,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/app.rs#L2946-L2982","documentation":"In the root approval-posture flow, after saving the new posture and unsetting the root approval_policy key, a failure to release the old root config policy triggers rollback: permission_posture is restored and the transaction re-saved. The Failed outcome string carries the release error plus a rollback_note recording whether the rollback itself succeeded — it is a reported outcome for the UI, not a panic.","triggerScenarios":"Thrown at crates/tui/src/tui/app.rs:2964 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the outcome message plus rollback_note to see both the release failure and whether settings were restored","Re-run the posture change after fixing config file permissions or locks","If rollback also failed, manually restore permission_posture in settings before retrying"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}