{"record":{"id":"e490d93fda8f0b76","repo":"risingwavelabs/risingwave","slug":"iceberg-snapshot-snapshot-id-not-found","errorCode":null,"errorMessage":"Iceberg snapshot {snapshot_id} not found","messagePattern":"Iceberg snapshot (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/metadata.rs","lineNumber":181,"sourceCode":"                    operation: snapshot.summary().operation.as_str().to_owned(),\n                    manifest_list: snapshot.manifest_list().to_owned(),\n                    summary,\n                };\n                if let Some(chunk) = append_row(&mut builder, row)? {\n                    yield chunk;\n                }\n            }\n        }\n        IcebergMetadataTableType::Manifests | IcebergMetadataTableType::Files => {\n            let Some(snapshot_id) =\n                IcebergSplitEnumerator::get_snapshot_id(&table, time_travel_info)?\n            else {\n                return Ok(());\n            };\n            let snapshot = table\n                .metadata()\n                .snapshot_by_id(snapshot_id)\n                .ok_or_else(|| anyhow!(\"Iceberg snapshot {snapshot_id} not found\"))?;\n            let metadata = table.metadata_ref();\n            let object_cache = table.object_cache();\n            let manifest_list = object_cache.get_manifest_list(snapshot, &metadata).await?;\n\n            if metadata_type == IcebergMetadataTableType::Manifests {\n                for manifest in manifest_list.entries() {\n                    let content = manifest.content.to_string();\n                    let row = IcebergManifestRow {\n                        content,\n                        path: manifest.manifest_path.clone(),\n                        length: manifest.manifest_length,\n                        partition_spec_id: manifest.partition_spec_id,\n                        sequence_number: manifest.sequence_number,\n                        min_sequence_number: manifest.min_sequence_number,\n                        added_snapshot_id: manifest.added_snapshot_id,\n                        added_files_count: optional_u32_to_i32(\n                            manifest.added_files_count,\n                            \"added_files_count\",","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/metadata.rs#L163-L199","documentation":"The iceberg_snapshot_{summary|manifests|files} metadata tables take a snapshot_id; the requested snapshot is looked up via metadata().snapshot_by_id. If no snapshot with that id exists, the scan fails with this error.","triggerScenarios":"Querying e.g. `SELECT * FROM t.snapshots(...) ` style metadata tables (or function taking snapshot id) with a snapshot id that was expired/removed, a typo'd id, or an id from a different table.","commonSituations":"Snapshot expired by retention/expired-snapshot cleanup between obtaining the id and querying; using an id captured from an old query against a rewritten table.","solutions":["Query the snapshots metadata table to list currently valid snapshot ids","Re-run with a valid, existing snapshot_id","Disable/avoid snapshot expiration if you need long-lived snapshot references"],"exampleFix":"-- before\nSELECT * FROM t.snapshot_files(snapshot_id => 9999999999999999999);\n-- after\nSELECT * FROM t.snapshots(); -- find a valid id first, then use it","handlingStrategy":"validation","validationCode":"let valid_ids: HashSet<i64> = table.metadata().snapshots().map(|s| s.snapshot_id()).collect();\nif !valid_ids.contains(&snapshot_id) { return Err(format!(\"snapshot {snapshot_id} not found\")); }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"not found\") => refresh_snapshot_list_and_retry(),\n    other => other?,\n}","preventionTips":["Fetch snapshot ids fresh from the snapshots metadata table before use","Avoid holding snapshot references across retention/expiration jobs"],"tags":["iceberg","metadata","snapshot","not-found"],"backgroundTag":"record-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}