{"record":{"id":"df22009e9e948435","repo":"zed-industries/zed","slug":"delete-password-failed-status","errorCode":null,"errorMessage":"delete password failed: {status}","messagePattern":"delete password failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macos/src/platform.rs","lineNumber":1274,"sourceCode":"                let password = CFType::wrap_under_get_rule(*password)\n                    .downcast::<CFData>()\n                    .context(\"password was not a string\")?;\n\n                Ok(Some((username.to_string(), password.bytes().to_vec())))\n            }\n        })\n    }\n\n    fn delete_credentials(&self, url: &str) -> Task<Result<()>> {\n        let url = url.to_string();\n\n        self.background_executor().spawn(async move {\n            unsafe {\n                use security::*;\n\n                let url = CFString::from(url.as_str());\n                let mut query_attrs = CFMutableDictionary::with_capacity(2);\n                query_attrs.set(kSecClass as *const _, kSecClassInternetPassword as *const _);\n                query_attrs.set(kSecAttrServer as *const _, url.as_CFTypeRef());\n\n                let status = SecItemDelete(query_attrs.as_concrete_TypeRef());\n                anyhow::ensure!(status == errSecSuccess, \"delete password failed: {status}\");\n            }\n            Ok(())\n        })\n    }\n}\n\nunsafe fn path_from_objc(path: id) -> PathBuf {\n    let len = msg_send![path, lengthOfBytesUsingEncoding: NSUTF8StringEncoding];\n    let bytes = unsafe { path.UTF8String() as *const u8 };\n    let path = str::from_utf8(unsafe { slice::from_raw_parts(bytes, len) }).unwrap();\n    PathBuf::from(path)\n}\n\nunsafe fn get_mac_platform(object: &mut Object) -> &MacPlatform {","sourceCodeStart":1256,"sourceCodeEnd":1292,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_macos/src/platform.rs#L1256-L1292","documentation":"Guard in delete_credentials: SecItemDelete returned a non-zero OSStatus while removing the internet-password item for the server. {status} is the Security framework code; errSecItemNotFound is common when the credential was already absent.","triggerScenarios":"Thrown at crates/gpui_macos/src/platform.rs:1242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat errSecItemNotFound as success (nothing to delete)","Check keychain access/entitlements for permission-related statuses","Surface genuine failures so sign-out flows can report that stored credentials remain"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}