{"record":{"id":"0728ce7a7f061a66","repo":"rustfs/rustfs","slug":"network-error-message","errorCode":null,"errorMessage":"Network error: {message}","messagePattern":"Network error: (.+?)","errorType":"exception","errorClass":"LockError","httpStatus":null,"severity":"error","filePath":"crates/lock/src/error.rs","lineNumber":35,"sourceCode":"use 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\n    /// Invalid lock handle\n    #[error(\"Invalid lock handle: {handle_id}\")]\n    InvalidHandle { handle_id: String },\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/rustfs/rustfs/blob/35af688cd9d41b4346fbe27dcf7250ba72046c1f/crates/lock/src/error.rs#L17-L53","documentation":"A network-level failure occurred while talking to the lock service; the underlying transport error is preserved as `source` for the error chain. The wrapper adds the lock-operation context while keeping the original cause diagnosable.","triggerScenarios":"Lock service unreachable (connection refused/reset); request timed out at the transport layer; DNS resolution failure for lock service endpoints; connection dropped mid-operation.","commonSituations":"Lock service restarting or redeploying; network partitions between storage nodes and lock nodes; misconfigured endpoints or firewall rules; proxy interference on loopback in tests.","solutions":["Verify the lock service endpoints are reachable from this node (port, DNS, firewall)","Retry with backoff for transient connection resets — lock ops are idempotent per owner/handle","Inspect the boxed `source` for the real transport error before acting","For CI/test failures, check proxy env leakage to localhost endpoints"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"fn is_lock_network(e: &rustfs_lock::error::LockError) -> bool {\n    matches!(e, rustfs_lock::error::LockError::Network { .. })\n}","tryCatchPattern":"match op.await {\n    Err(e) if is_lock_network(&e) => { backoff_and_retry().await }\n    other => other?,\n}","preventionTips":["Inspect e.source() — the real transport error decides whether retrying helps","Health-check lock endpoints and keep them out of maintenance windows for lock-heavy jobs","For local tests, bypass proxies for 127.0.0.1 to avoid fabricated network failures"],"tags":["rust","lock","network","io"],"backgroundTag":"network-error","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"}