Hi all! :wave: Could someone please help me with ...
# troubleshooting
j
Hi all! 👋 Could someone please help me with this? I’m not sure whether this is a bug or if I misconfigured something. Using Flink
1.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 🧵
Copy code
2023-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)
I’ve found the issue for this 😅 I’m using hashmap state backend and I set
taskmanager.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 🙂
a
@Jasmin Redzepovic you should not set it to zero. You apparently have some state - even if very little one. Try setting it to an absolute amount (and not a ratio) and see if it works. I’m not sure if it’s the same setting or a similar one - but there’s a setting to set the task manager’s managed memory to X bytes
👍 1