{"record":{"id":"909172778f55179f","repo":"linera-io/linera-protocol","slug":"no-admin-chain-root-0-in-genesis-config","errorCode":null,"errorMessage":"no admin chain (Root(0)) in genesis config","messagePattern":"no admin chain \\(Root\\(0\\)\\) in genesis config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-bridge/src/main.rs","lineNumber":338,"sourceCode":"        let client = reqwest::Client::new();\n\n        let resp = client\n            .post(&self.faucet_url)\n            .json(&serde_json::json!({\n                \"query\": \"{ currentCommittee { validators } currentEpoch genesisConfig }\"\n            }))\n            .send()\n            .await?\n            .json::<GqlResponse>()\n            .await?;\n\n        let admin_chain_id = resp\n            .data\n            .genesis_config\n            .chains\n            .iter()\n            .find(|c| c.origin() == ChainOrigin::Root(0))\n            .ok_or_else(|| anyhow::anyhow!(\"no admin chain (Root(0)) in genesis config\"))?\n            .id();\n        let admin_chain_bytes = *admin_chain_id.0.as_bytes();\n\n        let mut validators: Vec<String> = Vec::new();\n        let mut weights: Vec<u64> = Vec::new();\n\n        for (public_key, state) in &resp.data.current_committee.validators {\n            let address = validator_evm_address(public_key);\n            validators.push(format!(\"{address}\"));\n            weights.push(state.votes);\n        }\n\n        let result = serde_json::json!({\n            \"validators\": validators,\n            \"weights\": weights,\n            \"admin_chain_id\": format!(\"0x{}\", alloy_primitives::hex::encode(admin_chain_bytes)),\n            \"epoch\": resp.data.current_epoch,\n            \"pause_guardian\": self.pause_guardian,","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-bridge/src/main.rs#L320-L356","documentation":"The 'init-light-client' command queries the faucet's GraphQL endpoint for currentCommittee, currentEpoch and genesisConfig, then requires a genesis chain whose origin is ChainOrigin::Root(0) — the Linera admin chain. This error means genesisConfig.chains contains no Root(0) entry, so the light client cannot be initialized from this endpoint.","triggerScenarios":"Running init-light-client with --faucet-url pointing at a network whose genesis config has no Root(0) chain: a custom/devnet genesis where the admin chain is not the first root chain, a staging or incompatible network, or a faucet version that returns a partial genesisConfig.","commonSituations":"Wrong --faucet-url (testnet faucet instead of the target network); running a private Linera network whose genesis was generated with a different admin chain setup; faucet/API version mismatch after an upgrade.","solutions":["Point --faucet-url at the faucet of the exact network the bridge targets","Run the raw query '{ genesisConfig { chains { id } } }' against the faucet and confirm a Root(0)-origin chain exists","For private networks, regenerate genesis so the admin chain is created as ChainOrigin::Root(0)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Preflight: query the faucet and confirm Root(0) exists before running the command.\nlet resp: serde_json::Value = client.post(&faucet_url)\n    .json(&serde_json::json!({\"query\": \"{ genesisConfig { chains { id } } }\"}))\n    .send().await?.json().await?;\nassert!(resp[\"data\"][\"genesisConfig\"][\"chains\"].as_array().is_some_and(|c| !c.is_empty()));","typeGuard":null,"tryCatchPattern":"match InitLightClientOptions::run(&opts).await {\n    Err(e) if e.to_string().contains(\"no admin chain\") => {\n        // wrong network: stop and re-check --faucet-url instead of proceeding\n    }\n    other => other?,\n}","preventionTips":["Pin the faucet URL per target network in config, never hand-edit per run","Smoke-test new faucets with a raw genesisConfig query before relying on them","Document which networks carry the Root(0) admin chain required by the light client"],"tags":["faucet","graphql","genesis","bridge","configuration"],"backgroundTag":"genesis-config-invalid","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}