{"record":{"id":"3e657f82de2b13d7","repo":"rustfs/rustfs","slug":"permission-denied-reason","errorCode":null,"errorMessage":"Permission denied: {reason}","messagePattern":"Permission denied: (.+?)","errorType":"exception","errorClass":"LockError","httpStatus":null,"severity":"error","filePath":"crates/lock/src/error.rs","lineNumber":31,"sourceCode":"// limitations under the License.\n\nuse crate::LockId;\nuse std::time::Duration;\nuse thiserror::Error;\n\n/// Lock operation related error types\n#[derive(Error, Debug)]\npub enum LockError {\n    /// Lock acquisition timeout\n    #[error(\"Lock acquisition timeout for resource '{resource}' after {timeout:?}\")]\n    Timeout { resource: String, timeout: Duration },\n\n    /// Resource not found\n    #[error(\"Resource not found: {resource}\")]\n    ResourceNotFound { resource: String },\n\n    /// Permission denied\n    #[error(\"Permission denied: {reason}\")]\n    PermissionDenied { reason: String },\n\n    /// Network error\n    #[error(\"Network error: {message}\")]\n    Network {\n        message: String,\n        #[source]\n        source: Box<dyn std::error::Error + Send + Sync>,\n    },\n\n    /// Internal error\n    #[error(\"Internal error: {message}\")]\n    Internal { message: String },\n\n    /// Resource is already locked\n    #[error(\"Resource '{resource}' is already locked by {owner}\")]\n    AlreadyLocked { resource: String, owner: String },\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/rustfs/rustfs/blob/35af688cd9d41b4346fbe27dcf7250ba72046c1f/crates/lock/src/error.rs#L13-L49","documentation":"The lock operation was denied for permission reasons. Lock ownership and access are scoped per owner/identity; the lock service refused the request because the caller lacks the right to lock the resource or act on the lock.","triggerScenarios":"Releasing or extending a lock whose ownership does not match the caller's identity; a lock-service ACL that excludes the requesting node; credentials changing between acquisition and use.","commonSituations":"Multiple services sharing a lock namespace with different identities; rotated credentials invalidating an established session; misconfigured lock-service permissions after a redeploy.","solutions":["Confirm the operation is being performed by the same owner identity that acquired the lock","Check and correct the lock-service access configuration for the requesting node","Do not retry blindly — permission denial is deterministic until configuration changes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_permission_denied(e: &rustfs_lock::error::LockError) -> bool {\n    matches!(e, rustfs_lock::error::LockError::PermissionDenied { .. })\n}","tryCatchPattern":"match op.await {\n    Err(e) if is_permission_denied(&e) => alert_config(&e), // needs operator action\n    other => other?,\n}","preventionTips":["Use one consistent owner identity for the full lock session","Validate lock-service access configuration at startup","Never retry permission denials automatically"],"tags":["rust","lock","permissions","access-denied"],"backgroundTag":"permission-denied","analyzedSha":"35af688cd9d41b4346fbe27dcf7250ba72046c1f","analyzedAt":"2026-08-20T21:57:04.799Z","contentChangedAt":"2026-08-20T21:57:04.799Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}