{"record":{"id":"317735dc078f4528","repo":"apache/iceberg","slug":"exception-planning-scan-for-at-317735","errorCode":null,"errorMessage":"Exception planning scan for {} at {}","messagePattern":"Exception planning scan for (.+?) at (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/MetadataTablePlanner.java","lineNumber":101,"sourceCode":"        ThreadPools.newFixedThreadPool(table.name() + \"-table-planner\", workerPoolSize);\n    this.splitSerializer = new IcebergSourceSplitSerializer(scanContext.caseSensitive());\n    this.errorCounter =\n        TableMaintenanceMetrics.groupFor(\n                getRuntimeContext(), originalTable.name(), taskName, taskIndex)\n            .counter(TableMaintenanceMetrics.ERROR_COUNTER);\n  }\n\n  @Override\n  public void processElement(Trigger trigger, Context ctx, Collector<SplitInfo> out)\n      throws Exception {\n    try {\n      table.refresh();\n      for (IcebergSourceSplit split :\n          FlinkSplitPlanner.planIcebergSourceSplits(table, scanContext, workerPool)) {\n        out.collect(new SplitInfo(splitSerializer.getVersion(), splitSerializer.serialize(split)));\n      }\n    } catch (Exception e) {\n      LOG.warn(\"Exception planning scan for {} at {}\", table, ctx.timestamp(), e);\n      ctx.output(DeleteOrphanFiles.ERROR_STREAM, e);\n      errorCounter.inc();\n    }\n  }\n\n  @Override\n  public void close() throws Exception {\n    super.close();\n    tableLoader.close();\n    if (workerPool != null) {\n      workerPool.shutdown();\n    }\n  }\n\n  public static class SplitInfo {\n    private final int version;\n    private final byte[] split;\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/MetadataTablePlanner.java#L83-L119","documentation":"Warning from the Flink maintenance MetadataTablePlanner when planning a scan over a metadata table (e.g. all_manifests/files) fails. The exception is emitted to the DeleteOrphanFiles ERROR_STREAM and counted, so that planning round produces no splits and downstream cleanup may be skipped for safety.","triggerScenarios":"processElement calls table.refresh() then FlinkSplitPlanner.planIcebergSourceSplits; any exception during refresh or planning (snapshot expiry racing, corrupt metadata JSON, thread pool/worker pool errors, catalog timeouts) is caught and logged.","commonSituations":"Table metadata refreshed while snapshots were concurrently expired; catalog unavailable or slow; corrupted or unreadable manifest list files; worker pool misconfiguration.","solutions":["Inspect the side-output ERROR_STREAM for the root exception","Re-run the maintenance action; refresh races are typically transient","Check catalog connectivity and metadata file integrity for the table","Reduce concurrency/worker pool size if planning fails from thread exhaustion"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure the table is loadable and refreshable before planning\ncatalog.loadTable(tableIdent).refresh();","typeGuard":null,"tryCatchPattern":"try { planSplits(table, scanContext); } catch (Exception e) { LOG.warn(\"Exception planning scan for {}\", table, e); errorCounter.inc(); }","preventionTips":["Avoid running ExpireSnapshots concurrently with metadata scans","Check catalog health/connectivity before starting maintenance jobs","Monitor the ERROR_STREAM side output for planning failures","Size the worker pool appropriately for the table size"],"tags":["flink","scan-planning","metadata-table"],"backgroundTag":"api-request-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}