{"record":{"id":"234c062cba5838de","repo":"linera-io/linera-protocol","slug":"eventsnotfound-234c06","errorCode":"EventsNotFound","errorMessage":"ExecutionError::EventsNotFound(missing_events)","messagePattern":"ExecutionError::EventsNotFound\\(missing_events\\)","errorType":"exception","errorClass":"ExecutionError","httpStatus":null,"severity":"error","filePath":"linera-execution/src/system.rs","lineNumber":666,"sourceCode":"                    .checked_sub(1)\n                    .ok_or(ArithmeticError::Underflow)?;\n                let event_id = EventId {\n                    chain_id,\n                    stream_id,\n                    index,\n                };\n                let context = self.context();\n                let extra = context.extra();\n                let mut missing_events = Vec::new();\n                txn_tracker\n                    .oracle(|| async {\n                        if !extra.contains_event(event_id.clone()).await? {\n                            missing_events.push(event_id.clone());\n                        }\n                        Ok(OracleResponse::EventExists(event_id))\n                    })\n                    .await?;\n                ensure!(\n                    missing_events.is_empty(),\n                    ExecutionError::EventsNotFound(missing_events)\n                );\n            }\n            Checkpoint => {\n                return Err(ExecutionError::InternalError(\n                    \"SystemOperation::Checkpoint must be dispatched at ExecutionStateView level\",\n                ));\n            }\n        }\n\n        Ok(new_application)\n    }\n\n    /// Returns an error if the `provided` epoch is not exactly one higher than the chain's current\n    /// epoch.\n    fn check_next_epoch(&self, provided: Epoch) -> Result<(), ExecutionError> {\n        let expected = self.epoch.get().try_add_one()?;","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-execution/src/system.rs#L648-L684","documentation":"At the end of an UpdateStream, the system verifies the publisher's newest event (EventId at index next_index - 1 on the publisher chain and stream) is readable by this node via the extra context's contains_event oracle (system.rs:660-668). If any checked event is missing locally, the operation fails with EventsNotFound listing the missing EventIds, so a subscriber never records progress past events it cannot actually read.","triggerScenarios":"Executing UpdateStream when the subscriber's local node does not have the publisher's latest event blob: events not yet synced/gossiped from the publisher chain, blob fetches still pending, or the events having been pruned or checkpointed away before this node retrieved them.","commonSituations":"Nodes processing streams right after the publisher emitted, before cross-chain data propagated; indexer/explorer or late-joining nodes lacking historical publisher data; publisher chains pruning old events (or publishing checkpoints) while slow subscribers lag behind; local test setups where nodes were restarted without storage of previously seen events.","solutions":["Retry after the node syncs: wait for or trigger the fetch of the missing events from peers, then resubmit the UpdateStream operations.","Ensure event/blob distribution is healthy so the publisher's events reach the subscriber's node (check peer connectivity, blob gossip).","For late joiners or pruned history, obtain the publisher's events (or its checkpoint snapshot) from storage/peers before resuming stream processing.","If older events are permanently gone, resubscribe from the current index (unsubscribe then subscribe) and accept the gap rather than replaying pruned events."],"exampleFix":"// before\nclient.submit_operations(update_stream_ops).await?; // EventsNotFound [...]\n\n// after: ensure the referenced event exists locally first, else retry later\nloop {\n    let missing = node.query_event(publisher_event_id).await;\n    if missing.is_ok() { break; }\n    tokio::time::sleep(Duration::from_secs(5)).await; // wait for blob/event sync\n}\nclient.submit_operations(update_stream_ops).await?;","handlingStrategy":"retry","validationCode":"// verify the newest referenced event exists locally before submitting\nlet event_id = EventId { chain_id: publisher, stream_id, index: next_index - 1 };\nif node.get_event(event_id.clone()).await.is_err() {\n    // trigger/await event sync first; skip this round\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(ExecutionError::EventsNotFound(missing)) => {\n        // transient sync gap: fetch/wait for the listed events, then retry the\n        // same UpdateStream once storage has them; give up only if the events\n        // are confirmed pruned and resubscribe from the current index instead\n    }\n    other => other,\n}","preventionTips":["Keep the node's cross-chain event/blob sync healthy before processing streams.","Monitor subscriber lag so publisher events are fetched before any pruning window expires.","For late-joining nodes, backfill publisher history (or checkpoints) before enabling stream processing."],"tags":["linera","event-streams","data-sync","blobs","subscriptions"],"backgroundTag":"missing-event-data","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}