{"record":{"id":"1290f8511d5360f8","repo":"apache/iceberg","slug":"failed-to-create-tablemaintenance-1290f8","errorCode":null,"errorMessage":"Failed to create tableMaintenance ","messagePattern":"Failed to create tableMaintenance ","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/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.2/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java#L287-L323","documentation":"IcebergSink.addPostCommitTopology builds the table maintenance (expire snapshots/rewrite data files) operator; an IOException during its construction is wrapped as UncheckedIOException with this message. It means the post-commit maintenance topology could not be initialized, typically because the table cannot be read from the loader.","triggerScenarios":"Calling .append() on an IcebergSink builder with maintenance enabled when the maintenance builder's table access throws IOException — table metadata unreadable, catalog/warehouse unreachable, or credentials missing on the JobManager.","commonSituations":"HDFS/S3 outage at job startup; kerberos/HMS auth not configured; table deleted between submit and run; misconfigured maintenance properties pointing at missing resources.","solutions":["Inspect the wrapped cause for the underlying IO failure (path missing, auth, timeout).","Verify the table exists and TableLoader config is valid from the cluster.","Ensure filesystem/catalog credentials are available to the JobManager; retry submission after the storage issue resolves."],"exampleFix":"// before: maintenance on missing table\nIcebergSink.forRowData(input).table(table).tableLoader(loader).append();\n// after: validate first\nif (!catalog.tableExists(tableId)) throw new IllegalStateException(\"table missing\");\nIcebergSink.forRowData(input).table(catalog.loadTable(tableId)).tableLoader(loader).append();","handlingStrategy":"validation","validationCode":"// validate table access and maintenance prerequisites before enabling maintenance\ntry (TableLoader loader = tableLoader) {\n  loader.open();\n  Table t = loader.loadTable();\n  Preconditions.checkArgument(catalog.tableExists(tableId), \"table missing: %s\", tableId);\n}","typeGuard":null,"tryCatchPattern":"try {\n  sink.append();\n} catch (UncheckedIOException e) {\n  if (e.getMessage().startsWith(\"Failed to create tableMaintenance\")) {\n    logger.error(\"maintenance init failed\", e.getCause());\n  }\n  throw e;\n}","preventionTips":["Verify table/catalog reachability from the JobManager before enabling maintenance.","Disable maintenance (don't set maintenance properties) until storage issues are resolved.","Monitor metastore/HDFS health in deployment checks."],"tags":["flink","maintenance","io","topology"],"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"}