wg0120 opened a new issue, #15435:
URL: https://github.com/apache/iotdb/issues/15435

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and 
found nothing similar.
   
   
   ### Version
   
   2.0.2
   
   ### Describe the bug and provide the minimal reproduce step
   
   1.创建设备模板
   2.挂载设备模板
   3.使用maven项目引入依赖
            <dependency>
               <groupId>org.apache.iotdb</groupId>
               <artifactId>iotdb-session</artifactId>
               <version>2.0.2</version>
           </dependency>
   4.使用以下方法插入设备数据
   sessionPool.insertRecord(deviceId, time, measurements, tsTypes, values);
   
   
   ### 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!


-- 
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]

Reply via email to