{"record":{"id":"12df33466012160b","repo":"linera-io/linera-protocol","slug":"nonexistent-chain-chain-id","errorCode":null,"errorMessage":"nonexistent chain `{chain_id}`","messagePattern":"nonexistent chain `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"linera-service/src/cli/main.rs","lineNumber":2655,"sourceCode":"                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                    );\n                }\n                wallet\n                    .remove(*chain_id)?\n                    .ok_or_else(|| anyhow::anyhow!(\"nonexistent chain `{chain_id}`\"))?;\n                info!(\"Chain forgotten in {} ms\", start_time.elapsed().as_millis());\n                Ok(0)\n            }\n\n            WalletCommand::Init {\n                genesis_config_path,\n                faucet,\n                testing_prng_seed,\n            } => {\n                let start_time = Instant::now();\n                let genesis_config: GenesisConfig = match (genesis_config_path, faucet) {\n                    (None, None) => {\n                        anyhow::bail!(\"please specify one of `--faucet` or `--genesis`.\")\n                    }\n                    (Some(genesis_config_path), _) => util::read_json(genesis_config_path)?,\n                    (None, Some(url)) => {\n                        let faucet = cli_wrappers::Faucet::new(url.clone());\n                        let version_info = faucet","sourceCodeStart":2637,"sourceCodeEnd":2673,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/main.rs#L2637-L2673","documentation":"`linera wallet forget <chain>` was asked to remove a chain that the wallet does not track: wallet.remove() returned None. The earlier guard already blocks forgetting the default chain, so this error specifically means the chain id is absent — already forgotten, never known to this wallet, or mistyped.","triggerScenarios":"Running forget twice; passing a chain id from a different wallet file; a typo or truncated chain id; wallet state where the chain was removed but the caller's notes were not updated.","commonSituations":"Idempotent-looking scripts that forget chains on cleanup; operators managing several wallet files and mixing up chain ids; copy-paste of ChainId with missing/extra characters.","solutions":["List what this wallet actually tracks: `linera wallet show`.","Copy the exact chain id from that listing and retry the forget command.","Confirm you are operating on the right wallet (--wallet path).","In scripts, treat this error as a no-op (chain already absent) if idempotency is desired."],"exampleFix":"# before: chain id not present in this wallet\nlinera wallet forget e5…9f   # -> \"nonexistent chain `e5…9f`\"\n\n# after: list chains, forget an existing one\nlinera wallet show\nlinera wallet forget <chain-id-from-show>","handlingStrategy":"validation","validationCode":"if !wallet.chain_ids().contains(chain_id) {\n    anyhow::bail!(\n        \"chain {chain_id} is not in this wallet — `linera wallet show` lists known chains\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always list chains with `linera wallet show` and copy the id from the output.","In cleanup scripts, treat 'nonexistent chain' as success (idempotent forget).","Confirm the --wallet path when managing several wallets."],"tags":["wallet","cli","chain"],"backgroundTag":"chain-not-in-wallet","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}