{"record":{"id":"0b5c56238f5e8fe7","repo":"FuelLabs/fuel-core","slug":"the-block-production-is-disabled","errorCode":null,"errorMessage":"The block production is disabled","messagePattern":"The block production is disabled","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/service/adapters/consensus_module/poa.rs","lineNumber":1241,"sourceCode":"    /// A block at this height already exists in the stream.\n    HeightExists,\n    /// Lock lost or epoch is stale — another leader holds the lock.\n    FencingRejected,\n}\n\nimpl PoAAdapter {\n    pub fn new(shared_state: Option<SharedState>) -> Self {\n        Self { shared_state }\n    }\n\n    pub async fn manually_produce_blocks(\n        &self,\n        start_time: Option<Tai64>,\n        mode: Mode,\n    ) -> anyhow::Result<()> {\n        self.shared_state\n            .as_ref()\n            .ok_or(anyhow!(\"The block production is disabled\"))?\n            .manually_produce_block(start_time, mode)\n            .await\n    }\n}\n\n#[async_trait::async_trait]\nimpl BlockReconciliationReadPort for NoopReconciliationAdapter {\n    async fn leader_state(\n        &self,\n        _next_height: BlockHeight,\n    ) -> anyhow::Result<LeaderState> {\n        Ok(LeaderState::ReconciledLeader)\n    }\n\n    async fn release(&self) -> anyhow::Result<()> {\n        Ok(())\n    }\n}","sourceCodeStart":1223,"sourceCodeEnd":1259,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service/adapters/consensus_module/poa.rs#L1223-L1259","documentation":"PoAAdapter wraps Option<SharedState>; the PoA service (and its shared state) is only constructed when block production is enabled (sub_services.rs:423-448: `production_enabled.then(...)`). With shared_state == None, manually_produce_blocks refuses immediately — manual production requires a running producer loop to interact with.","triggerScenarios":"Calling manually_produce_blocks (e.g. a dev/GraphQL block-production trigger) on a node whose PoA service was never created because block production is disabled in its configuration.","commonSituations":"Running a plain non-producing node (regular validator/follower) and trying to trigger manual production; disabling production in config while keeping dev tooling enabled; test harnesses constructing PoAAdapter::new(None).","solutions":["Start the node with block production enabled (dev/production consensus config) so SharedState exists.","Only invoke manual production on nodes actually configured as producers.","In tests/harnesses, construct the adapter with PoAAdapter::new(Some(shared_state))."],"exampleFix":"// before\nlet adapter = PoAAdapter::new(None); // production disabled\nadapter.manually_produce_blocks(None, mode).await?; // always errors\n\n// after — enable production so the PoA service (and SharedState) is built\n// (node config: enable block production), then:\nlet adapter = PoAAdapter::new(Some(shared_state));\nadapter.manually_produce_blocks(None, mode).await?;","handlingStrategy":"validation","validationCode":"// Before calling manually_produce_blocks, confirm the node actually runs\n// block production (PoA service was constructed) — e.g. reflect your config:\nfn block_production_enabled(cfg: &Config) -> bool {\n    cfg.consensus_key_config.is_some() /* or your production flag */\n}\nif !block_production_enabled(&config) {\n    anyhow::bail!(\"refusing manual production: node is not a producer\");\n}","typeGuard":null,"tryCatchPattern":"// If surfaced via an API layer, map to a clear client error:\nif let Err(e) = result {\n    if e.to_string().contains(\"block production is disabled\") {\n        return Err(anyhow!(\"this node is not configured for block production\"));\n    }\n    return Err(e);\n}","preventionTips":["Only expose manual-production endpoints on producer-configured nodes.","Fail fast at startup if your tooling requires production but config disables it.","Keep dev tooling and production flags in sync in node configuration."],"tags":["poa","block-production","configuration"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}