{"record":{"id":"ec7bff9279fd4ce6","repo":"apache/iceberg","slug":"failed-to-process-tasks-iterable-ec7bff","errorCode":null,"errorMessage":"Failed to process tasks iterable","messagePattern":"Failed to process tasks 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":68,"sourceCode":"      List<CombinedScanTask> tasks = Lists.newArrayList(tasksIterable);\n      FlinkInputSplit[] splits = new FlinkInputSplit[tasks.size()];\n      boolean exposeLocality = context.exposeLocality();\n\n      Tasks.range(tasks.size())\n          .stopOnFailure()\n          .executeWith(exposeLocality ? workerPool : null)\n          .run(\n              index -> {\n                CombinedScanTask task = tasks.get(index);\n                String[] hostnames = null;\n                if (exposeLocality) {\n                  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);","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitPlanner.java#L50-L86","documentation":"FlinkSplitPlanner.planInputSplits plans batch input splits for the legacy FlinkSource by iterating a CloseableIterable of CombinedScanTask. Any IOException raised while traversing the task iterable (e.g., reading manifests from FileIO) is wrapped in an UncheckedIOException with this message. It signals that split planning failed at the I/O layer, not that the query is invalid.","triggerScenarios":"Calling FlinkSplitPlanner.planInputSplits (directly or via FlinkSource) when the underlying table metadata or manifest files cannot be read — e.g., FileIO throwing IOException while listing/reading manifests or computing block locations (Util.blockLocations) during task iteration.","commonSituations":"Corrupted or deleted manifest files on HDFS/S3; transient network/credential failures reaching object storage; HDFS NameNode unavailability during batch split planning; permission errors reading table metadata.","solutions":["Verify table storage is reachable and credentials are valid (retry the job; check S3/HDFS connectivity and tokens).","Check for corrupted manifests: run the Iceberg 'remove_orphan_files'/'rewrite manifests' maintenance or inspect metadata JSON to confirm files exist.","Increase planning retry/timeout settings for the storage layer and re-submit the Flink job.","Inspect the wrapped IOException cause to pinpoint which file/operation failed and fix that specific access problem."],"exampleFix":"// before\nFlinkInputSplit[] splits = FlinkSplitPlanner.planInputSplits(table, context); // throws UncheckedIOException\n// after\ntry {\n  FlinkInputSplit[] splits = FlinkSplitPlanner.planInputSplits(table, context);\n} catch (UncheckedIOException e) {\n  LOG.error(\"Split planning failed due to IO problem; retrying after storage check\", e);\n  // verify storage access / table health before retry\n}","handlingStrategy":"try-catch","validationCode":"// verify table metadata is readable before planning\nTableMetadata metadata = TableMetadataParser.read(table.io(), table.location() + \"/metadata/version-hint.text\");\nPreconditions.checkNotNull(metadata, \"table metadata unreadable\");","typeGuard":null,"tryCatchPattern":"try {\n  FlinkInputSplit[] splits = FlinkSplitPlanner.planInputSplits(table, context);\n} catch (UncheckedIOException e) {\n  // e.getCause() is the IOException; decide retry vs fail based on storage health\n  throw new RuntimeException(\"Split planning IO failure; check storage\", e.getCause());\n}","preventionTips":["Validate storage connectivity and credentials before submitting the job.","Avoid running destructive table maintenance concurrently with scan planning.","Monitor and retry transient object-storage errors at the FileIO layer."],"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"}