Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19587

clarify why JMX item is unsupported in case of InstanceNotFoundException

XMLWordPrintable

    • Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021), Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021)
    • 0.5

      I use key:

      jmx["java.lang:type=GarbageCollector,name=PS MarkSweep",LastGcInfo.startTime]
      

      Imagine that I used incorrect mbean name so my items gets unsupported with an error description in frontend just:

      java.lang:type=GarbageCollector,name=PS MarkSweep
      

      While if look to debug of java gateway we also can see this quite useful word: javax.management.InstanceNotFoundException

      Here is full debug:

      2021-06-18 13:47:49.324 [pool-1-thread-1] DEBUG com.zabbix.gateway.SocketProcessor - dispatched request to class com.zabbix.gateway.JMXItemChecker
      2021-06-18 13:47:49.325 [pool-1-thread-1] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:rmi:///jndi/rmi://127.0.0.1:12345/jmxrmi'
      2021-06-18 13:47:49.425 [pool-1-thread-1] DEBUG com.zabbix.gateway.ItemChecker - getting value for item 'jmx["java.lang:type=GarbageCollector,name=PS MarkSweep",LastGcInfo.startTime]'
      2021-06-18 13:47:49.441 [pool-1-thread-1] DEBUG com.zabbix.gateway.ItemChecker - caught exception for item 'jmx["java.lang:type=GarbageCollector,name=PS MarkSweep",LastGcInfo.startTime]'
      javax.management.InstanceNotFoundException: java.lang:type=GarbageCollector,name=PS MarkSweep
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) ~[na:na]
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643) ~[na:na]
              at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678) ~[na:na]
              at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1445) ~[na:na]
              at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[na:na]
              at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[na:na]
              at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) ~[na:na]
              at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:639) ~[na:na]
              at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source) ~[na:na]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
              at java.lang.reflect.Method.invoke(Method.java:498) ~[na:na]
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346) ~[na:na]
              at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[na:na]
              at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[na:na]
              at java.security.AccessController.doPrivileged(Native Method) ~[na:na]
              at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[na:na]
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) ~[na:na]
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) ~[na:na]
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) ~[na:na]
              at java.security.AccessController.doPrivileged(Native Method) ~[na:na]
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) ~[na:na]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:na]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:na]
              at java.lang.Thread.run(Thread.java:745) ~[na:na]
              at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303) ~[na:na]
              at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279) ~[na:na]
              at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164) ~[na:na]
              at jdk.remoteref/jdk.jmx.remote.internal.rmi.PRef.invoke(Unknown Source) ~[na:na]
              at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source) ~[na:na]
              at java.management.rmi/javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:904) ~[na:na]
              at com.zabbix.gateway.JMXItemChecker.getStringValue(JMXItemChecker.java:184) ~[zabbix-java-gateway.jar:na]
              at com.zabbix.gateway.ItemChecker.getJSONValue(ItemChecker.java:92) ~[zabbix-java-gateway.jar:na]
              at com.zabbix.gateway.JMXItemChecker.getValues(JMXItemChecker.java:107) ~[zabbix-java-gateway.jar:na]
              at com.zabbix.gateway.SocketProcessor.run(SocketProcessor.java:79) ~[zabbix-java-gateway.jar:na]
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
              at java.base/java.lang.Thread.run(Thread.java:830) ~[na:na]
      2021-06-18 13:47:49.444 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - sending the following data in response: {"data":[{"error":"java.lang:type=GarbageCollector,name=PS MarkSweep"}],"response"
      2021-06-18 13:47:49.445 [pool-1-thread-1] DEBUG com.zabbix.gateway.SocketProcessor - finished processing incoming connection
      

      I wonder, wold it be possible to include the "InstanceNotFoundException" part to error message too?

      That would be much more clear that it's a response form a remote JMX agent, but not sole local side issue.

            vso Vladislavs Sokurenko
            zalex_ua Oleksii Zagorskyi
            Team A
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: