Jasmin Redzepovic
03/07/2023, 12:06 AM1.15.2 and Flink k8s operator 1.2.0.
Error: switched from INITIALIZING to FAILED with failure cause: java.lang.NullPointerException: Initial Segment may not be null
I have implemented a Window Top-N job that uses Kafka topic as a source and another Kafka topic as a sink. When running the job locally in the IDE, everything works well and results are outputted to the Kafka sink. However, when I deploy the job to the Flink Kubernetes Operator, I get an Initial Segment may not be null error.
Detailed stack trace in thread 🧵Jasmin Redzepovic
03/07/2023, 12:07 AM2023-03-06 23:17:45,084 INFO org.apache.flink.runtime.state.heap.HeapKeyedStateBackendBuilder [] - Finished to build heap keyed state-backend.
2023-03-06 23:17:45,101 INFO org.apache.flink.runtime.state.heap.HeapKeyedStateBackend [] - Initializing heap keyed state backend with stream factory.
2023-03-06 23:17:45,285 WARN org.apache.flink.runtime.taskmanager.Task [] - WindowRank[10] -> Calc[11] -> LocalWindowAggregate[12] (1/1)#0 (3d3eed883046177f683400a075933b89) switched from INITIALIZING to FAILED with failure cause: java.lang.NullPointerException: Initial Segment may not be null
at org.apache.flink.runtime.memory.AbstractPagedOutputView.<init>(AbstractPagedOutputView.java:67)
at org.apache.flink.runtime.io.disk.SimpleCollectingOutputView.<init>(SimpleCollectingOutputView.java:46)
at org.apache.flink.table.runtime.util.collections.binary.AbstractBytesMultiMap$RecordArea.<init>(AbstractBytesMultiMap.java:226)
at org.apache.flink.table.runtime.util.collections.binary.AbstractBytesMultiMap.<init>(AbstractBytesMultiMap.java:114)
at org.apache.flink.table.runtime.util.collections.binary.WindowBytesMultiMap.<init>(WindowBytesMultiMap.java:40)
at org.apache.flink.table.runtime.operators.aggregate.window.buffers.RecordsWindowBuffer.<init>(RecordsWindowBuffer.java:72)
at org.apache.flink.table.runtime.operators.aggregate.window.buffers.RecordsWindowBuffer$LocalFactory.create(RecordsWindowBuffer.java:205)
at org.apache.flink.table.runtime.operators.aggregate.window.LocalSlicingWindowAggOperator.open(LocalSlicingWindowAggOperator.java:101)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:107)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:700)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:676)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:643)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:948)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:917)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:741)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:563)
at java.base/java.lang.Thread.run(Unknown Source)Jasmin Redzepovic
03/07/2023, 12:02 PMtaskmanager.memory.managed.size=0 as it is recommended in the documentation. (maybe it should be written that if not using state, set that property to 0?)
After removing that option from the configuration, job is successfully deployed and running.
@Amir Halatzi, tagging you because you had similar question before, maybe this will help 🙂Amir Halatzi
03/07/2023, 2:29 PM