{"record":{"id":"0444c419187887a5","repo":"apache/iceberg","slug":"failed-to-discover-new-splits","errorCode":null,"errorMessage":"Failed to discover new splits","messagePattern":"Failed to discover new splits","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/source/enumerator/ContinuousIcebergEnumerator.java","lineNumber":184,"sourceCode":"              result.toPosition());\n        } else {\n          LOG.info(\n              \"No new splits discovered between ({}, {}]\",\n              result.fromPosition(),\n              result.toPosition());\n        }\n        // update the enumerator position even if there is no split discovered\n        // or the toPosition is empty (e.g. for empty table).\n        enumeratorPosition.set(result.toPosition());\n        LOG.info(\"Update enumerator position to {}\", result.toPosition());\n      }\n    } else {\n      consecutiveFailures++;\n      if (scanContext.maxAllowedPlanningFailures() < 0\n          || consecutiveFailures <= scanContext.maxAllowedPlanningFailures()) {\n        LOG.error(\"Failed to discover new splits\", error);\n      } else {\n        throw new RuntimeException(\"Failed to discover new splits\", error);\n      }\n    }\n  }\n}\n","sourceCodeStart":166,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/source/enumerator/ContinuousIcebergEnumerator.java#L166-L189","documentation":"The continuous enumerator's split discovery (planning) failed repeatedly. Failures are tolerated up to maxAllowedPlanningFailures (or indefinitely if negative); once consecutive failures exceed that limit, processDiscoveredSplits rethrows as RuntimeException and the enumerator fails.","triggerScenarios":"Continuous streaming enumeration when table.scan throws (e.g., snapshot expired, catalog/network errors) and consecutiveFailures exceeds scanContext.maxAllowedPlanningFailures().","commonSituations":"See trigger scenarios.","solutions":["Fix the underlying planning error (check logs for the wrapped cause: catalog connectivity, permissions, expired snapshot).","Increase streaming-planning-failures (maxAllowedPlanningFailures) to tolerate transient outages.","Set maxAllowedPlanningFailures to -1 to retry indefinitely if failures are expected to be transient.","Extend snapshot retention / increase min-snapshots-to-keep so referenced snapshots are not expired."],"exampleFix":"// before\ntable.updateProperties().set(\"streaming-planning-failures\", \"0\");\n// after\ntable.updateProperties().set(\"streaming-planning-failures\", \"10\"); // tolerate transient planning failures","handlingStrategy":"retry","validationCode":"// Verify table is readable before starting the streaming source\ntry (org.apache.iceberg.TableScan scan = table.newScan()) {\n  scan.useSnapshot(table.currentSnapshot().snapshotId()).planFiles();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set table property streaming-planning-failures to a positive value to tolerate transient catalog errors","Increase snapshot retention (history.expire.min-snapshots-to-keep) so streaming snapshots are not expired","Monitor catalog connectivity and permissions before long-running streaming reads"],"tags":["flink","streaming","split-planning","retry-exhausted"],"backgroundTag":"request-timeout","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}