{"record":{"id":"50942cbb38b2e73e","repo":"apache/iceberg","slug":"failed-to-create-tablemaintenance-50942c","errorCode":null,"errorMessage":"Failed to create tableMaintenance ","messagePattern":"Failed to create tableMaintenance ","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java","lineNumber":305,"sourceCode":"      } else {\n        builder = TableMaintenance.forChangeStream(tableChangeStream, tableLoader);\n      }\n\n      builder\n          .uidSuffix(tableMaintenanceUid)\n          .add(maintenanceTasks)\n          .rateLimit(Duration.ofSeconds(flinkMaintenanceConfig.rateLimit()))\n          .lockCheckDelay(Duration.ofSeconds(flinkMaintenanceConfig.lockCheckDelay()))\n          .parallelism(flinkMaintenanceConfig.parallelism());\n\n      String slotSharingGroup = flinkMaintenanceConfig.slotSharingGroup();\n      if (slotSharingGroup != null) {\n        builder.slotSharingGroup(slotSharingGroup);\n      }\n\n      builder.append();\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to create tableMaintenance \", e);\n    }\n  }\n\n  @Override\n  public DataStream<RowData> addPreWriteTopology(DataStream<RowData> inputDataStream) {\n    return distributeDataStream(inputDataStream);\n  }\n\n  @Override\n  public DataStream<CommittableMessage<IcebergCommittable>> addPreCommitTopology(\n      DataStream<CommittableMessage<WriteResult>> writeResults) {\n    TypeInformation<CommittableMessage<IcebergCommittable>> typeInformation =\n        CommittableMessageTypeInfo.of(this::getCommittableSerializer);\n\n    String suffix = defaultSuffix(uidSuffix, table.name());\n    String preCommitAggregatorUid = String.format(\"Sink pre-commit aggregator: %s\", suffix);\n\n    // global forces all output records send to subtask 0 of the downstream committer operator.","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java#L287-L323","documentation":"IcebergSink.addPostCommitTopology wraps IOException from building the table maintenance (compaction/expire/orphan-cleanup) topology and rethrows it as UncheckedIOException. It means the sink could not append the maintenance operators to the job graph, typically because the underlying catalog/table operations failed with IO problems.","triggerScenarios":"Calling IcebergSink builder with maintenance enabled (tableLoader-based catalogs) where TableMaintenance's internal catalog/table access throws IOException while appending the topology via builder.append().","commonSituations":"Catalog storage (HDFS/S3) unavailable or misconfigured when the sink starts; credentials expired so metadata files can't be read; table deleted/moved between sink construction and topology build.","solutions":["Verify the catalog and filesystem are reachable and credentials are valid before submitting the Flink job","Confirm the table still exists at the loader's location and the table loader configuration is correct","Inspect the wrapped IOException cause for the concrete storage/catalog failure and fix that root cause","Disable or reconfigure table maintenance (maintenance settings) if it is not needed for this sink"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Table t;\ntry (TableLoader loader = tableLoader) {\n  loader.open();\n  t = loader.loadTable(); // fail fast before building the sink\n}","typeGuard":null,"tryCatchPattern":"try {\n  sinkBuilder.append();\n} catch (UncheckedIOException e) {\n  Throwable root = ExceptionUtils.getRootCause(e);\n  LOG.error(\"table maintenance topology failed: {}\", root.getMessage(), root);\n  throw e;\n}","preventionTips":["Pre-flight check catalog/filesystem connectivity before submitting the Flink job","Refresh credentials (e.g. S3 session tokens) for long-lived clusters before job restarts","Confirm the table still exists right before deployment"],"tags":["flink","sink","maintenance","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"}