Hide Forgot
Description of problem: If credname returned by sigar is not set (null) discovery of the ActiveMQ server fails with NullPointerException: ******************************************** DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.jbosson.plugins.fuse.JBossFuseContainerDiscoveryComponent)- Error when trying to discover Fuse Server process [ProcessScanResult: scan=[ProcessScan: query=[process|basename|match=^java.*,arg|-Dkaraf.home|match=.*,arg|-Dkaraf.base|match=.*,arg|*|match=org\.apache\.karaf\.(main|shell\.wrapper)\.Main], name=[null]], info=[process: pid=[29383], name=[/app/software/jdk1.7.0_55/bin/java], ppid=[29336]]]. java.lang.RuntimeException: Failed to extract JMX service URL for process with PID [29383]. at org.rhq.plugins.jmx.util.JvmUtility.extractJMXServiceURL(JvmUtility.java:93) at org.jbosson.plugins.fuse.FuseServerDiscoveryComponent.discoverResourceDetails(FuseServerDiscoveryComponent.java:273) at org.jbosson.plugins.fuse.FuseServerDiscoveryComponent.discoverResources(FuseServerDiscoveryComponent.java:94) at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.rhq.plugins.jmx.util.JvmUtility.attachToVirtualMachine(JvmUtility.java:107) at org.rhq.plugins.jmx.util.JvmUtility.extractJMXServiceURL(JvmUtility.java:76) ... 10 more ******************************************** Normally, pinfo returns credname set as in [2]. [1] ********************************************* [testUser@test lib] java -jar 'sigar-1.6.5.132-6.jar' pinfo 54804 pid=54804 state={Name=java, Threads=332, Tty=0, State=S, Ppid=54760, Processor=1, Priority=20, Nice=0} mem={Resident=3802157056, PageFaults=37230840, MajorFaults=0, Share=21520384, MinorFaults=37230840, Size=7872376832} cpu={User=13370920, LastTime=1475081008046, Percent=0.0, StartTime=1474974387000, Total=14365690, Sys=994770} cred={Euid=25958, Gid=25958, Egid=25958, Uid=25958} ********************************************* [2] ********************************************* [testUser@test lib]$ java -jar 'sigar-1.6.5.132-6.jar' pinfo 26418 pid=26418 state={Name=java, Threads=108, Tty=34819, State=S, Ppid=26368, Processor=7, Priority=20, Nice=0} mem={Resident=372408320, PageFaults=187036, MajorFaults=0, Share=23486464, MinorFaults=187036, Size=5299863552} cpu={User=108750, LastTime=1475220798994, Percent=0.0, StartTime=1475159585000, Total=150960, Sys=42210} cred={Euid=1000, Gid=1000, Egid=1000, Uid=1000} credname={User=testUser, Group=testUser} ********************************************* Version-Release number of selected component (if applicable): JBoss ON 3.3.0 How reproducible: Sometimes (when user is ldap user); Steps to Reproduce: 1. 2. 3. Actual results: Autodiscovery fails and NullPointerException is logged. Expected results: Autodiscovery works and no error is shown in the log file. In case that credname is null, we should try to use some other way of attaching to JVM. Additional info:
By default, we use other method than attach. Attach is only a fallback and requires the agent to be running as same user as the attached process. The only possible fix (to make the connection) here is to compare the (E)UIDs of the agent and the target process, if the credName is really missing.
Fixed in the master: commit 87208f971b4e78c6236abcc9ea50c4ec34825825 Author: Michael Burman <miburman> Date: Fri Jan 13 14:38:11 2017 +0200 [BZ 1382041] If procCredName is not available, use process eUid comparison for attach capabilities
Lets add this one to the previous one: commit 6f7107850611ccf9bc32cce79bed81cb75fa6f79 Author: Michael Burman <miburman> Date: Fri Jan 13 15:07:13 2017 +0200 Replace direct Sigar access with proxy
*** Bug 1289445 has been marked as a duplicate of this bug. ***
Tested in JON 3.3.8 ER01. Issue 1: Able to discover ActiveMQ in JON successfully. However, in logs of JON (server.log attached) in is showing product as JBoss, which is not correct, it should show ActiveMQ. But in UI it shows Jboss fuse Container Issue 2: Not able to monitor ActiveMQ Steps followed: 1) Edit jboss-a-mq-6.2.1.redhat-159/etc/users.properties to add admin user: "admin=admin,admin,manager,viewer,Operator, Maintainer, Deployer, Auditor, Administrator, SuperUser" 2) navigate to Jboss Fuse container >> Inventory >> Connection Settings 3) edit Principal and Credentials as admin, admin. After these settings JON should display ActiveMQ available as Active MQ is running successfully(attached screen-shot "activemq.png"). However, it is not showing any error in server.log of JON or agent.log of agent but in JON UI it shows error(attached screen-shot error.png).
Created attachment 1244234 [details] active mq logs
Created attachment 1244236 [details] error.png
Created attachment 1244244 [details] JON server log
Created attachment 1244245 [details] JON agent log
If it's detected as "JBoss Fuse Container" incorrectly, then this is something that JBoss Fuse / ActiveMQ plugin authors should fix, it's not a bug in the JON 3.3.8. But that has nothing to do with the original bug, which is about JMX detection with undetected userName. And that does not fail.
I believe this bug should be marked VERIFIED and new bugs should be captured for any new issues. This bug is about discovery while the others appear to be related to specific functions of the plug-in or a configuration issue. For issue 1., you will need to provide complete steps in the new bug as it is not clear. Active-MQ from this BZ is part of Fuse and would be deployed to an EAP server. Therefore, it would either get identified with EAP as its parent resource or a layered JBoss Fuse Container parent resource. For issue 2., an agent debug log would be helpful. Also, please keep in mind that if any of your steps were performed out of order or timing was an issue, a service discovery scan would need to be performed. Moving back to ON_QA for further action.
Created new bugs for new issues. So keeping this bug as verified because able discover ActiveMQ in JON 3.3.8 ER01
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2017-0285.html