zed-industries/zed · error
delete password failed: {status}
Error message
delete password failed: {status} What it means
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.
Source
Thrown at crates/gpui_macos/src/platform.rs:1274
let password = CFType::wrap_under_get_rule(*password)
.downcast::<CFData>()
.context("password was not a string")?;
Ok(Some((username.to_string(), password.bytes().to_vec())))
}
})
}
fn delete_credentials(&self, url: &str) -> Task<Result<()>> {
let url = url.to_string();
self.background_executor().spawn(async move {
unsafe {
use security::*;
let url = CFString::from(url.as_str());
let mut query_attrs = CFMutableDictionary::with_capacity(2);
query_attrs.set(kSecClass as *const _, kSecClassInternetPassword as *const _);
query_attrs.set(kSecAttrServer as *const _, url.as_CFTypeRef());
let status = SecItemDelete(query_attrs.as_concrete_TypeRef());
anyhow::ensure!(status == errSecSuccess, "delete password failed: {status}");
}
Ok(())
})
}
}
unsafe fn path_from_objc(path: id) -> PathBuf {
let len = msg_send![path, lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
let bytes = unsafe { path.UTF8String() as *const u8 };
let path = str::from_utf8(unsafe { slice::from_raw_parts(bytes, len) }).unwrap();
PathBuf::from(path)
}
unsafe fn get_mac_platform(object: &mut Object) -> &MacPlatform {View on GitHub (pinned to 9d272b0363)
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at crates/gpui_macos/src/platform.rs:1242 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/df22009e9e948435.
Report an issue: GitHub.