rustfs/rustfs · error · LockError
Network error: {message}
Error message
Network error: {message} What it means
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.
Source
Thrown at crates/lock/src/error.rs:35
use thiserror::Error;
/// Lock operation related error types
#[derive(Error, Debug)]
pub enum LockError {
/// Lock acquisition timeout
#[error("Lock acquisition timeout for resource '{resource}' after {timeout:?}")]
Timeout { resource: String, timeout: Duration },
/// Resource not found
#[error("Resource not found: {resource}")]
ResourceNotFound { resource: String },
/// Permission denied
#[error("Permission denied: {reason}")]
PermissionDenied { reason: String },
/// Network error
#[error("Network error: {message}")]
Network {
message: String,
#[source]
source: Box<dyn std::error::Error + Send + Sync>,
},
/// Internal error
#[error("Internal error: {message}")]
Internal { message: String },
/// Resource is already locked
#[error("Resource '{resource}' is already locked by {owner}")]
AlreadyLocked { resource: String, owner: String },
/// Invalid lock handle
#[error("Invalid lock handle: {handle_id}")]
InvalidHandle { handle_id: String },
View on GitHub (pinned to 35af688cd9)
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
Defensive patterns
Strategy: retry
Type guard
fn is_lock_network(e: &rustfs_lock::error::LockError) -> bool {
matches!(e, rustfs_lock::error::LockError::Network { .. })
} Try / catch
match op.await {
Err(e) if is_lock_network(&e) => { backoff_and_retry().await }
other => other?,
} Prevention
- 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
When it happens
Trigger: Lock service unreachable (connection refused/reset); request timed out at the transport layer; DNS resolution failure for lock service endpoints; connection dropped mid-operation.
Common situations: Lock service restarting or redeploying; network partitions between storage nodes and lock nodes; misconfigured endpoints or firewall rules; proxy interference on loopback in tests.
Related errors
- invalid encryption algorithm ID: {0}
- crypto feature is disabled
- failed to write hash and data
- shard read timed out
- I/O error: {0}
AI-assisted analysis of rustfs/rustfs@35af688cd9 (2026-08-20).
Data as JSON: /api/errors/0728ce7a7f061a66.
Report an issue: GitHub.