linera-io/linera-protocol · error

Not possible to work with RocksDB

Error message

Not possible to work with RocksDB

What it means

Same net-up storage mapping as the memory case, but for plain RocksDB: even with the `rocksdb` feature compiled in, `database()` rejects `InnerStorageConfig::RocksDb`. Only the service backend, ScyllaDb, and the dual RocksDb+ScyllaDb combination are accepted for the multi-process local net (dual is handled as its own `Database::DualRocksDbScyllaDb` variant).

Source

Thrown at linera-service/src/cli/net_up_utils.rs:89

                Ok(StorageConfigProvider { config })
            }
        }
    }

    pub fn inner_storage_config(&self) -> &InnerStorageConfig {
        &self.config.inner_storage_config
    }

    pub fn namespace(&self) -> &str {
        &self.config.namespace
    }

    pub fn database(&self) -> anyhow::Result<Database> {
        match self.config.inner_storage_config {
            InnerStorageConfig::Memory { .. } => anyhow::bail!("Not possible to work with memory"),
            #[cfg(feature = "rocksdb")]
            InnerStorageConfig::RocksDb { .. } => {
                anyhow::bail!("Not possible to work with RocksDB")
            }
            #[cfg(feature = "storage-service")]
            InnerStorageConfig::Service { .. } => Ok(Database::Service),
            #[cfg(feature = "scylladb")]
            InnerStorageConfig::ScyllaDb { .. } => Ok(Database::ScyllaDb),
            #[cfg(all(feature = "rocksdb", feature = "scylladb"))]
            InnerStorageConfig::DualRocksDbScyllaDb { .. } => Ok(Database::DualRocksDbScyllaDb),
        }
    }
}

/// Starts a local test network and, optionally, a faucet and block exporter.
#[expect(clippy::too_many_arguments)]
pub async fn handle_net_up_service(
    num_other_initial_chains: u32,
    initial_amount: u128,
    num_initial_validators: usize,
    num_shards: usize,

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Use `--storage scylladb:<config>` for a ScyllaDB-backed net
  2. Use `--storage service:<endpoint>` (or omit `--storage` to auto-start a storage service)
  3. Use the dual rocksdb+scylladb backend string, which maps to `Database::DualRocksDbScyllaDb` and is accepted
  4. Check `linera net up --help` for the accepted `--storage` schemes

Example fix

# before
linera net up --storage rocksdb:tmp/net_db

# after
linera net up --storage scylladb:127.0.0.1:9042
Defensive patterns

Strategy: validation

Validate before calling

// Reject plain rocksdb before starting a local net.
if matches!(storage_config.inner_storage_config, InnerStorageConfig::RocksDb { .. }) {
    anyhow::bail!("net up does not accept plain rocksdb; use service:, scylladb:, or the dual rocksdb+scylladb backend");
}

Prevention

When it happens

Trigger: Running `linera net up --storage rocksdb:<path>` — the config parses into `InnerStorageConfig::RocksDb` and hits the bail at linera-service/src/cli/net_up_utils.rs:89.

Common situations: Reusing the rocksdb storage string that works for single-validator `linera server` commands; examples or docs configured for plain RocksDB; choosing RocksDB to avoid running ScyllaDB locally.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/44f27d33549a028d. Report an issue: GitHub.