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

  1. Verify the lock service endpoints are reachable from this node (port, DNS, firewall)
  2. Retry with backoff for transient connection resets — lock ops are idempotent per owner/handle
  3. Inspect the boxed `source` for the real transport error before acting
  4. 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

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


AI-assisted analysis of rustfs/rustfs@35af688cd9 (2026-08-20). Data as JSON: /api/errors/0728ce7a7f061a66. Report an issue: GitHub.