I think this should go into 3.3. Additional comment (at the end) from Elias explains why +++ This bug was initially created as a clone of Bug #1127029 +++ Description of problem: I have a agent in my network (don't know which one) connecting to RHQ with not so good results: 01:16:45,788 INFO [org.rhq.enterprise.server.core.CoreServerServiceImpl] (http-/0.0.0.0:7080-13) Agent [null][4.12.0(422702f)] would like to connect to this server It would be helpful if the message included the remote client IP address, but I don't know and it's difficult to know when there are hundreds of existing agents. Version-Release number of selected component (if applicable): 4.12 How reproducible: Unclear Steps to Reproduce: 1. Unclear Additional info: diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterpris index 2e4ddfc..162e44c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java @@ -336,6 +336,11 @@ public ConnectAgentResults connectAgent(ConnectAgentRequest request) throws Agen String agentName = request.getAgentName(); AgentVersion agentVersion = request.getAgentVersion(); + if (agentName == null) { + String msg = request.getAddress() + ':' + request.getPort() + "] is connecting without a name"; + throw new AgentNotSupportedException(msg); + } + log.info("Agent [" + agentName + "][" + agentVersion + "] would like to connect to this server"); if (!getAgentManager().isAgentVersionSupported(agentVersion)) { This can't work because there is no way to get the IP/port from this request. IP/port should probably be available for every request, although not clear from an API standpoint how that might work. (I don't think the client should tell what IP it is, the server knows that already.) --- Additional comment from Elias Ross on 2014-08-05 21:47:30 EDT --- Okay, what happened was installing a new storage node, the installer tries to install a new agent, though one was already installed on the host in a different location. It blew away the preferences directory for an already installed agent and caused trouble.
Letting soak in master for a few days, then will cherry-pick if things look good.
release/jon3.3.x commit 3e4f9571733ea0c7867acf693efc5fc82110b41a Author: Jay Shaughnessy <jshaughn> Date: Tue Aug 19 10:07:21 2014 -0400 Cherry-pick master: 1106141fb59aefa027602c138f59b33f4347466a
Moving to ON_QA as available for test with the following brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=381194
installed storage node (with agent) on an VM where agent was already installed and running and connected to server. Connected new agent to server with different port, both are running, only the latest one is connected to server. NO 'null' name in server and/or agent logs. marking as verified