{"record":{"id":"e83836e3c003fa4a","repo":"linera-io/linera-protocol","slug":"checkpointpreconditionfailed","errorCode":"CheckpointPreconditionFailed","errorMessage":"ExecutionError::CheckpointPreconditionFailed(\"chain has published system events\")","messagePattern":"ExecutionError::CheckpointPreconditionFailed\\(\"chain has published system events\"\\)","errorType":"exception","errorClass":"ExecutionError","httpStatus":null,"severity":"error","filePath":"linera-execution/src/execution.rs","lineNumber":146,"sourceCode":"        &mut self,\n        maximum_blob_size: u64,\n    ) -> Result<Vec<Blob>, ExecutionError> {\n        // User event streams are summarized and pruned by the checkpoint itself (see\n        // `ExecutionStateActor`'s checkpoint handler), so they do not block checkpointing.\n        // System event streams (e.g. the epoch streams on the admin chain) are not\n        // summarized, so a chain that published any is still not allowed to checkpoint.\n        let mut had_system_event_block = false;\n        self.previous_event_blocks\n            .for_each_index_while(|stream_id| {\n                if matches!(stream_id.application_id, GenericApplicationId::System) {\n                    had_system_event_block = true;\n                    Ok(false)\n                } else {\n                    Ok(true)\n                }\n            })\n            .await?;\n        ensure!(\n            !had_system_event_block,\n            ExecutionError::CheckpointPreconditionFailed(\"chain has published system events\")\n        );\n\n        let (bytes, _content_hash) = self.inner.dump_content().await?;\n        let chunk_size = usize::try_from(maximum_blob_size).unwrap_or(usize::MAX);\n        Ok(bytes\n            .chunks(chunk_size)\n            .map(|chunk| {\n                Blob::new(BlobContent::new(\n                    BlobType::CheckpointExecutionState,\n                    chunk.to_vec(),\n                ))\n            })\n            .collect())\n    }\n\n    /// Registers the pre-block-computed checkpoint inputs (from","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-execution/src/execution.rs#L128-L164","documentation":"prepare_checkpoint validates a SystemOperation::Checkpoint before dumping chain state: it walks previous_event_blocks and refuses to checkpoint if any event stream in it belongs to the System application (e.g. the epoch stream published by the admin chain). User event streams are summarized and pruned by the checkpoint itself, but system event streams are not, so checkpointing would lose them; the operation fails with CheckpointPreconditionFailed.","triggerScenarios":"Executing SystemOperation::Checkpoint on a chain that has ever published system events, typically the admin chain, which publishes EPOCH_STREAM_NAME events whenever a committee or epoch is created.","commonSituations":"Trying to checkpoint the admin chain itself; chains that combine system duties (epoch/committee publication) with application load; test chains reused for both epoch publication and checkpoint tests; node upgrades where checkpoint eligibility rules were tightened.","solutions":["Run the checkpoint from a chain that has never published system events (not the admin chain)","Keep epoch and committee administration isolated on the admin chain and checkpoint only application chains","Before proposing a checkpoint, verify the chain's event streams contain no GenericApplicationId::System entries"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_checkpoint_precondition_failed(err: &ExecutionError) -> bool {\n    matches!(err, ExecutionError::CheckpointPreconditionFailed(_))\n}","tryCatchPattern":"match state.prepare_checkpoint(max_blob_size).await {\n    Ok(blobs) => blobs,\n    Err(ref e) if is_checkpoint_precondition_failed(e) => {\n        // chain state makes it ineligible; do not retry on this chain\n        return Err(anyhow!(\"this chain has published system events and cannot checkpoint\"));\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Checkpoint only from dedicated application chains, never the admin chain","Keep epoch and committee publication off chains that will be checkpointed","Before proposing SystemOperation::Checkpoint, review the chain's system event streams"],"tags":["checkpoint","system-events","admin-chain","linera"],"backgroundTag":"checkpoint-precondition-failed","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}