risingwavelabs/risingwave · error · StorageError

Sled error

Error message

Sled error: {0}

What it means

A StorageError variant wrapping sled::Error. Sled is an embedded key-value store used in some RisingWave paths (e.g. local meta/state backends); any sled engine failure — I/O error, corruption, lock contention — is wrapped here.

Solutions

  1. Check disk space, permissions, and health of the directory backing the sled database
  2. If the DB is corrupt or from an incompatible sled version, re-initialize the directory and rebuild state (or restore from backup)
  3. Enable sled recovery options only after backing up the data directory
Defensive patterns

Strategy: try-catch

Validate before calling

fn sled_dir_ok(path: &std::path::Path) -> bool {
    path.exists() && path.is_dir()
        && std::fs::read_dir(path).map(|mut d| d.next().is_some()).unwrap_or(false)
}

Try / catch

match open_store().await {
    Err(e) if matches!(e.kind(), StorageErrorKind::Sled(_)) => {
        // check disk space/permissions, or re-init corrupted sled dir
    }
    other => other,
}

Prevention

When it happens

Trigger: Any operation on a sled-backed store returning Err: opening a corrupted database file, I/O failures on the data directory, incompatible sled data format versions.

Common situations: Disk full or permission problems on the data directory; corrupted embedded DB after a crash; running with a sled data directory created by a different sled version.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/706876669af6b0d2. Report an issue: GitHub.

Appendix: source

Thrown at src/storage/src/error.rs:45

        #[from]
        HummockError,
    ),

    #[error("Deserialize row error: {0}")]
    DeserializeRow(
        #[from]
        #[backtrace]
        ValueEncodingError,
    ),

    #[error("Serialize/deserialize error: {0}")]
    SerdeError(
        #[from]
        #[backtrace]
        memcomparable::Error,
    ),

    #[error("Sled error: {0}")]
    Sled(
        #[backtrace]
        #[from]
        sled::Error,
    ),

    #[error("MemTable error: {0}")]
    MemTable(
        #[backtrace]
        #[from]
        Box<MemTableError>,
    ),
}

pub type StorageResult<T> = std::result::Result<T, StorageError>;

View on GitHub (pinned to 6469eb736d)