{"record":{"id":"adf43db78a5eed7e","repo":"apache/iceberg","slug":"failed-to-process-task-iterable-adf43d","errorCode":null,"errorMessage":"Failed to process task iterable: ","messagePattern":"Failed to process task iterable: ","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java","lineNumber":80,"sourceCode":"                  hostnames = Util.blockLocations(table.io(), task);\n                }\n                splits[index] = new FlinkInputSplit(index, task, hostnames);\n              });\n      return splits;\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to process tasks iterable\", e);\n    }\n  }\n\n  /** This returns splits for the FLIP-27 source */\n  public static List<IcebergSourceSplit> planIcebergSourceSplits(\n      Table table, ScanContext context, ExecutorService workerPool) {\n    try (CloseableIterable<CombinedScanTask> tasksIterable =\n        planTasks(table, context, workerPool)) {\n      return Lists.newArrayList(\n          CloseableIterable.transform(tasksIterable, IcebergSourceSplit::fromCombinedScanTask));\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to process task iterable: \", e);\n    }\n  }\n\n  static CloseableIterable<CombinedScanTask> planTasks(\n      Table table, ScanContext context, ExecutorService workerPool) {\n    ScanMode scanMode = checkScanMode(context);\n    if (scanMode == ScanMode.INCREMENTAL_APPEND_SCAN) {\n      IncrementalAppendScan scan = table.newIncrementalAppendScan();\n      scan = refineScanWithBaseConfigs(scan, context, workerPool);\n\n      if (context.startTag() != null) {\n        Preconditions.checkArgument(\n            table.snapshot(context.startTag()) != null,\n            \"Cannot find snapshot with tag %s\",\n            context.startTag());\n        scan = scan.fromSnapshotExclusive(table.snapshot(context.startTag()).snapshotId());\n      }\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java#L62-L98","documentation":"planIcebergSourceSplits plans splits for the FLIP-27 IcebergSource by iterating a CloseableIterable of CombinedScanTask produced by planTasks. An IOException while iterating the task iterable (closing it or transforming entries) is wrapped into an UncheckedIOException with this message. It means the scan planning pipeline failed on an I/O problem while enumerating scan tasks.","triggerScenarios":"Calling planIcebergSourceSplits (via IcebergSource.enumerator/ batch splits) when iterating planTasks' CloseableIterable throws IOException — e.g., manifest reads fail via FileIO, or the try-with-resources close of the iterable fails.","commonSituations":"Object storage timeouts or throttling during parallel manifest scanning; manifests deleted by concurrent table maintenance (expire_snapshots); Kerberos/STS token expiry mid-planning; large table scans hitting storage read limits.","solutions":["Retry planning; ensure the enumerator restart path re-plans and that storage failures were transient.","Stop concurrent expireSnapshots/removeOrphanFiles maintenance while jobs are planning against the table.","Check storage credentials and network stability; refresh tokens (Kerberos ticket, cloud credentials).","Read the wrapped IOException cause to identify the failing manifest/file and repair table metadata if corrupted."],"exampleFix":"// before\nList<IcebergSourceSplit> splits = FlinkSplitPlanner.planIcebergSourceSplits(table, context, pool);\n// after\ntry {\n  List<IcebergSourceSplit> splits = FlinkSplitPlanner.planIcebergSourceSplits(table, context, pool);\n} catch (UncheckedIOException e) {\n  // inspect e.getCause(); retry or fall back to a re-planned scan\n  throw new JobRecoverableException(\"Recoverable planning failure\", e);\n}","handlingStrategy":"retry","validationCode":"// precheck: ensure current snapshot metadata files are readable\nSnapshot snapshot = table.currentSnapshot();\nif (snapshot != null) { table.io().newInputFile(snapshot.manifestListLocation()).getLength(); }","typeGuard":null,"tryCatchPattern":"try {\n  return FlinkSplitPlanner.planIcebergSourceSplits(table, context, workerPool);\n} catch (UncheckedIOException e) {\n  // treat as recoverable: enumerator restarts and re-plans\n  throw new IOException(\"Recoverable planning failure\", e.getCause());\n}","preventionTips":["Don't run expireSnapshots aggressively against tables consumed by streaming jobs.","Use retrying/token-refreshing FileIO implementations for cloud storage.","Keep consistent Hadoop/cloud SDK versions in the job jar."],"tags":["flink","io","split-planning","unchecked-io"],"backgroundTag":"file-read-failed","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"}