linera-io/linera-protocol · error

wallet not found at {}

Error message

wallet not found at {}

What it means

The bridge relayer refuses to start because the resolved wallet file does not exist. run() resolves the wallet path from the --wallet argument or falls back to <config_dir>/linera/wallet.json (e.g. ~/.config/linera/wallet.json), logs it under "Resolved paths", and hard-fails if it is missing — the relayer never creates wallets, it only uses existing ones.

Source

Thrown at linera-bridge/src/relay/mod.rs:131

        .context("no config directory on this platform")?
        .join("linera");
    let wallet_path =
        wallet_path.map_or_else(|| default_dir.join("wallet.json"), |p| p.to_path_buf());
    let keystore_path =
        keystore_path.map_or_else(|| default_dir.join("keystore.json"), |p| p.to_path_buf());
    let storage_path = storage_config.map_or_else(
        || format!("rocksdb:{}", default_dir.join("wallet.db").display()),
        |s| s.to_string(),
    );

    tracing::info!(
        wallet = %wallet_path.display(),
        keystore = %keystore_path.display(),
        storage = %storage_path,
        "Resolved paths"
    );

    anyhow::ensure!(
        wallet_path.exists(),
        "wallet not found at {}",
        wallet_path.display(),
    );

    let signer = linera_wallet_json::Keystore::read(&keystore_path)
        .context("failed to read keystore")?
        .into_signer();

    // Parse storage path: expect "rocksdb:/path/to/db"
    let db_path = storage_path
        .strip_prefix("rocksdb:")
        .context("storage config must start with 'rocksdb:'")?;
    let mut storage = create_rocksdb_storage(Path::new(db_path), cache_sizes).await?;

    // Wallet: must already exist
    tracing::info!(path = %wallet_path.display(), "Loading existing wallet");
    let wallet = PersistentWallet::read(&wallet_path).context("failed to read wallet")?;

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Check the "Resolved paths" log line to see exactly which path was checked.
  2. Create the wallet first with the linera CLI (`linera wallet init --genesis <genesis.json>`) on the same machine and config dir.
  3. Pass the correct explicit path: --wallet /path/to/wallet.json.
  4. If XDG_CONFIG_HOME or a container home is set, verify the wallet lives under the resulting config dir or pass --wallet explicitly.

Example fix

# before: relayer started with a wallet path that does not exist
linera-bridge-relay run --wallet /etc/linera/missing-wallet.json

# after: create the wallet, then start the relayer against it
linera wallet init --genesis genesis.json
linera-bridge-relay run --wallet ~/.config/linera/wallet.json
Defensive patterns

Strategy: validation

Validate before calling

let wallet_path = wallet_path.unwrap_or_else(|| default_wallet_path());
if !wallet_path.try_exists().unwrap_or(false) {
    eprintln!(
        "no wallet at {} — run `linera wallet init --genesis <file>` first",
        wallet_path.display()
    );
}

Prevention

When it happens

Trigger: Starting the relay with --wallet pointing at a nonexistent file, or with no --wallet on a machine where ~/.config/linera/wallet.json was never created; XDG_CONFIG_HOME overridden so the default path differs from where the wallet actually lives.

Common situations: Fresh server/container deployments that skipped wallet creation; scripts that assume the relayer provisions its own wallet; multiple wallets on one machine and the wrong default; typo in the path.

Related errors


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