vmtuan12 opened a new issue, #15303:
URL: https://github.com/apache/iceberg/issues/15303
### Query engine
Flink 1.20.3, with iceberg 1.9.1
### Question
Hi, i am trying flink sink to iceberg, with iceberg table maintenance. This
is the code
```java
Map<String, String> jdbcProps = new HashMap<>();
jdbcProps.put("jdbc.user", "flink_iceberg_user");
jdbcProps.put("jdbc.password", "abc123xyz");
jdbcProps.put("flink-maintenance.lock.jdbc.init-lock-tables",
"true");
TriggerLockFactory lockFactory = new JdbcLockFactory(
"jdbc:postgresql://infradb.lab:6432/flink_iceberg",
"catalog.db.flink_test_upsert",
// String.format("%s.%s.%s", catalog.name(),
tableName.namespace().toString(), tableName.name()),
jdbcProps
);
TableMaintenance.forTable(env, tableLoader, lockFactory)
.uidSuffix("production-maintenance")
.rateLimit(Duration.ofMinutes(2))
.lockCheckDelay(Duration.ofSeconds(30))
.parallelism(1)
// Daily snapshot cleanup
.add(ExpireSnapshots.builder()
.scheduleOnInterval(Duration.ofMinutes(2))
.maxSnapshotAge(Duration.ofMinutes(1))
.retainLast(1))
.append();
```
The lock remover fails
<img width="511" height="161" alt="Image"
src="https://github.com/user-attachments/assets/bd171419-a240-4d4e-a0d9-65b2b98ff4c9"
/>
Here are the logs
```
2026-02-12 09:03:12,017 WARN org.apache.flink.runtime.taskmanager.Task
[] - Lock remover (1/1)#1
(6f4d0d2882e73707370f0e74a31726a1_dc86d19e01b4aea788129c99f78947ac_0_1)
switched from RUNNING to FAILED with failure cause:
java.lang.NullPointerException: null
at
org.apache.iceberg.flink.maintenance.api.JdbcLockFactory$JdbcLock.instanceId(JdbcLockFactory.java:284)
~[iceberg-flink-runtime-1.20-1.9.1.jar:?]
at
org.apache.iceberg.flink.maintenance.api.JdbcLockFactory$JdbcLock.unlock(JdbcLockFactory.java:243)
~[iceberg-flink-runtime-1.20-1.9.1.jar:?]
at
org.apache.iceberg.flink.maintenance.operator.LockRemover.processWatermark(LockRemover.java:155)
~[iceberg-flink-runtime-1.20-1.9.1.jar:?]
at
org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitWatermark(OneInputStreamTask.java:244)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.watermarkstatus.StatusWatermarkValve.findAndOutputNewMinWatermarkAcrossAlignedSubpartitions(StatusWatermarkValve.java:283)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.watermarkstatus.StatusWatermarkValve.inputWatermark(StatusWatermarkValve.java:184)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:160)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:114)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:638)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:231)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:973)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:917)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:970)
~[flink-dist-1.20.3.jar:1.20.3]
at
org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:949)
[flink-dist-1.20.3.jar:1.20.3]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:763)
[flink-dist-1.20.3.jar:1.20.3]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:575)
[flink-dist-1.20.3.jar:1.20.3]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]
```
Can anyone tell me what's wrong? Thanks so much!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]