{"record":{"id":"842aeccab96c6b1a","repo":"linera-io/linera-protocol","slug":"signer-error","errorCode":null,"errorMessage":"Signer error","messagePattern":"Signer error","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/main.rs","lineNumber":2633,"sourceCode":"\n            WalletCommand::SetDefault { chain_id } => {\n                let start_time = Instant::now();\n                options.wallet()?.set_default_chain(*chain_id)?;\n                info!(\n                    \"Default chain set in {} ms\",\n                    start_time.elapsed().as_millis()\n                );\n                Ok(0)\n            }\n\n            WalletCommand::ForgetKeys { chain_id } => {\n                let start_time = Instant::now();\n                let owner = options.wallet()?.forget_keys(*chain_id)?;\n                if !options\n                    .keystore()?\n                    .contains_key(&owner)\n                    .await\n                    .expect(\"Signer error\")\n                {\n                    warn!(\"no keypair found in keystore for chain {chain_id}\");\n                }\n                info!(\n                    \"Chain keys forgotten in {} ms\",\n                    start_time.elapsed().as_millis()\n                );\n                Ok(0)\n            }\n\n            WalletCommand::ForgetChain { chain_id } => {\n                let start_time = Instant::now();\n                let wallet = options.wallet()?;\n                if wallet.default_chain() == Some(*chain_id) {\n                    anyhow::bail!(\n                        \"cannot forget the default chain `{chain_id}`; \\\n                         switch to another chain with `wallet set-default` first\"\n                    );","sourceCodeStart":2615,"sourceCodeEnd":2651,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/main.rs#L2615-L2651","documentation":"While processing wallet forget-keys, the CLI checks whether the keystore still holds the owner's key via keystore.contains_key(&owner).await. The .expect(\"Signer error\") panics when the keystore backend itself fails — an I/O or remote error, not a 'key missing' result (missing keys are the false branch and only log a warning).","triggerScenarios":"Running `linera wallet forget-keys` when the keystore backend errors: the keystore file is unreadable/deleted/corrupted, permissions changed, or (with a remote/KMS-style keystore) the backing service or credentials are unavailable.","commonSituations":"LINERA_KEYSTORE_HOME / --keystore pointing to a moved or deleted file; read-only mounts in containers; keystore JSON corrupted by concurrent writers; environment where a hardware/cloud signer is unreachable.","solutions":["Check the keystore path and permissions: ls -l on the keystore file and confirm the process user can read it","Point the command at the correct keystore with --keystore / LINERA_KEYSTORE_HOME if the wallet and keystore locations diverged","For remote signer backends, verify connectivity/credentials of the signer service first","Restore the keystore from backup or re-import the key, then re-run forget-keys"],"exampleFix":"# before\nlinera wallet forget-keys --chain-id 4ee5..c0de   # keystore path stale\n\n# after\nexport LINERA_KEYSTORE_HOME=/var/lib/linera\nls -l /var/lib/linera/keystore.json   # readable?\nlinera wallet forget-keys --chain-id 4ee5..c0de","handlingStrategy":"validation","validationCode":"# Pre-flight the keystore before wallet operations.\nKS=\"${LINERA_KEYSTORE_HOME:-$HOME}/keystore.json\"\ntest -r \"$KS\" || { echo \"keystore missing/unreadable: $KS\" >&2; exit 1; }\njq -e . \"$KS\" >/dev/null || { echo 'keystore is not valid JSON' >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin LINERA_KEYSTORE_HOME explicitly in automation instead of relying on defaults","Back up the keystore before any wallet mutation (forget-keys, keygen)","For remote signers, health-check the signer endpoint before wallet commands","Run CLI and keystore under the same OS user to avoid permission drift"],"tags":["linera","cli","keystore","wallet","io-error"],"backgroundTag":"keystore-unavailable","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}