{"record":{"id":"fc25476bcdfff06e","repo":"linera-io/linera-protocol","slug":"keystore-does-not-contain-a-key-for-owner-chain-o","errorCode":null,"errorMessage":"keystore does not contain a key for owner {chain_owner}","messagePattern":"keystore does not contain a key for owner (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-bridge/src/relay/mod.rs","lineNumber":177,"sourceCode":"        wallet,\n        signer.clone(),\n        &Default::default(),\n        None,\n        genesis_config,\n        linera_core::worker::DEFAULT_BLOCK_CACHE_SIZE,\n        linera_core::worker::DEFAULT_EXECUTION_STATE_CACHE_SIZE,\n    ))\n    .await?;\n\n    // ── Sync admin chain ──\n    tracing::info!(%admin_chain_id, \"Syncing admin chain from validators...\");\n    let admin_client = ctx.make_chain_client(admin_chain_id).await?;\n    admin_client.synchronize_from_validators().await?;\n    let admin_chain_height = admin_client.chain_info().await?.next_block_height;\n    tracing::info!(%admin_chain_height, \"Admin chain synced\");\n\n    // ── Register bridge chain in the local wallet ──\n    anyhow::ensure!(\n        signer\n            .contains_key(&chain_owner)\n            .await\n            .context(\"failed to query keystore\")?,\n        \"keystore does not contain a key for owner {chain_owner}\"\n    );\n\n    ctx.update_wallet_for_new_chain(\n        chain_id,\n        Some(chain_owner),\n        linera_base::data_types::Timestamp::default(),\n        linera_base::data_types::Epoch::ZERO,\n    )\n    .await?;\n\n    ctx.client\n        .extend_chain_mode(chain_id, linera_core::client::ListeningMode::FullChain);\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/relay/mod.rs#L159-L195","documentation":"The relayer loaded the keystore but it holds no private key for the configured bridge chain owner. After syncing the admin chain, run() verifies signer.contains_key(&chain_owner) because every bridge block on the relayed chain must be signed with that owner's key; the check fails closed at startup instead of failing per block later.","triggerScenarios":"chain_owner (from the bridge configuration) does not match any AccountOwner in keystore.json: keystore generated for a different owner, owner key never imported, or a bridge config created against another machine's keystore.","commonSituations":"Copying bridge config files between machines without copying keystore.json; regenerating the chain owner key during setup; mixing testnet/mainnet keystores; typos when passing the owner argument.","solutions":["Print the owner the relayer expects (it appears in the error and in the \"bridge chain\" config) and compare it with the owners in keystore.json.","Import or generate the owner's key into the keystore used at startup (keygen + add to keystore.json, or copy the matching keystore from the setup machine).","If the key is genuinely lost, re-register the bridge chain with a new owner that this keystore controls and update the relayer config.","Verify you passed --keystore pointing at the same keystore used during bridge setup."],"exampleFix":"# before: keystore.json has no entry for the configured chain owner\nlinera-bridge-relay run --keystore /etc/linera/keystore.json --chain-owner <owner>\n\n# after: generate/import the owner key into that keystore first\nlinera keygen   # (or paste the owner's secret key into keystore.json)\nlinera-bridge-relay run --keystore /etc/linera/keystore.json --chain-owner <owner>","handlingStrategy":"validation","validationCode":"let keystore = linera_wallet_json::Keystore::read(&keystore_path)?;\nlet owner: AccountOwner = bridge_config.chain_owner;\nensure!(\n    keystore.contains_key(&owner).await?,\n    \"owner {owner} missing from keystore — import the key before starting\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep keystore.json and the bridge config together when copying setups between machines.","Verify owner↔key mapping after any keygen or chain re-registration.","Automate the contains_key check in deployment preflight scripts."],"tags":["keystore","keys","account-owner","bridge"],"backgroundTag":"missing-key-in-keystore","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}