pentium100 opened a new issue, #4100:
URL: https://github.com/apache/hertzbeat/issues/4100

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Current Behavior
   
   [BUG] 当修改一个使用了服务发现的监控时,后台会抛异常
   
   2026-03-29 15:22:10 [http-nio-1157-exec-1] ERROR 
org.apache.hertzbeat.manager.support.GlobalExceptionHandler - 
[monitor]-[unknown error happen]-null
   java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:220)
        at 
java.base/java.util.ImmutableCollections$MapN.<init>(ImmutableCollections.java:1437)
        at java.base/java.util.Map.of(Map.java:1384)
        at 
org.apache.hertzbeat.manager.service.impl.MonitorServiceImpl.modifyMonitor(MonitorServiceImpl.java:418)
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:359)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
   
   新建时不会,就是修改会。原因是修改的服务上没有处理scrape为service discovery时,instance为空的情况。
   
   
   ### Expected Behavior
   
   _No response_
   
   ### Steps To Reproduce
   
   1. add any type of monitor
   2. select nacos service discovery
   3. fill nacos server information.
   4. confirm it.
   5. edit monitor.
   6. don't change any thing , just save it.
   7. you will got error.
   
   ### Environment
   
   ```markdown
   HertzBeat version(s): v1.8.0
   ```
   
   ### Debug logs
   
   _No response_
   
   ### Anything else?
   
   _No response_


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

Reply via email to