[Bug] 2.0.2版本 设置设备模板后,插入数据报错
Search before asking
- [x] I searched in the issues and found nothing similar.
Version
2.0.2
Describe the bug and provide the minimal reproduce step
1.创建设备模板
2.挂载设备模板
3.使用maven项目引入依赖
What did you expect to see?
数据成功插入到数据库
What did you see instead?
iotdb数据库报错日志
2025-04-29 11:17:54,999 [pool-56-IoTDB-ClientRPC-Processor-1$20250429_031754_00048_1.1.0] WARN o.a.i.d.q.p.s.FragmentInstanceDispatcherImpl:514 - write locally failed. TSStatus: TSStatus(code:305, message:internal error. statemachine throws a runtime exception: java.lang.NullPointerException), message: internal error. statemachine throws a runtime exception: java.lang.NullPointerException
2025-04-29 11:18:55,506 [1@group-000200000009-StateMachineUpdater] ERROR o.a.i.c.r.ApplicationStateMachineProxy:157 - application statemachine throws a runtime exception:
java.lang.NullPointerException: null
at org.apache.iotdb.db.schemaengine.rescon.MemSchemaEngineStatistics.lambda$getTemplateSeriesNumber$0(MemSchemaEngineStatistics.java:142)
at java.util.stream.ReferencePipeline$5$1.accept(ReferencePipeline.java:227)
at java.util.concurrent.ConcurrentHashMap$EntrySpliterator.forEachRemaining(ConcurrentHashMap.java:3606)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.LongPipeline.reduce(LongPipeline.java:438)
at java.util.stream.LongPipeline.sum(LongPipeline.java:396)
at org.apache.iotdb.db.schemaengine.rescon.MemSchemaEngineStatistics.getTemplateSeriesNumber(MemSchemaEngineStatistics.java:144)
at org.apache.iotdb.db.schemaengine.rescon.MemSchemaEngineStatistics.getTotalSeriesNumber(MemSchemaEngineStatistics.java:124)
at org.apache.iotdb.db.schemaengine.rescon.MemSchemaRegionStatistics.getGlobalSeriesNumber(MemSchemaRegionStatistics.java:230)
at org.apache.iotdb.db.schemaengine.schemaregion.impl.SchemaRegionMemoryImpl.activateSchemaTemplate(SchemaRegionMemoryImpl.java:1358)
at org.apache.iotdb.db.consensus.statemachine.schemaregion.SchemaExecutionVisitor.visitActivateTemplate(SchemaExecutionVisitor.java:436)
at org.apache.iotdb.db.consensus.statemachine.schemaregion.SchemaExecutionVisitor.visitActivateTemplate(SchemaExecutionVisitor.java:94)
at org.apache.iotdb.db.queryengine.plan.planner.plan.node.metadata.write.ActivateTemplateNode.accept(ActivateTemplateNode.java:175)
at org.apache.iotdb.db.consensus.statemachine.schemaregion.SchemaRegionStateMachine.write(SchemaRegionStateMachine.java:182)
at org.apache.iotdb.consensus.ratis.ApplicationStateMachineProxy.applyTransaction(ApplicationStateMachineProxy.java:153)
at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:1839)
at org.apache.ratis.server.impl.StateMachineUpdater.applyLog(StateMachineUpdater.java:255)
at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:193)
at java.lang.Thread.run(Thread.java:748)
Anything else?
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!
麻烦提供下 创建、挂载的 sql,以及数据写入的代码。