Bug 1006604 - Agent registration silently fails if server auto-detection and multicast is enabled and another agent with the same name or address is already registered to the server
Agent registration silently fails if server auto-detection and multicast is e...
Status: NEW
Product: RHQ Project
Classification: Other
Component: Agent (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-09-10 17:45 EDT by Larry O'Leary
Modified: 2013-09-10 17:45 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Larry O'Leary 2013-09-10 17:45:07 EDT
Description of problem:
If agent configuration options rhq.agent.server-auto-detection and rhq.communications.multicast-detector.enabled are set to true and another agent is already registered on the target server using the same name or address, the agent simply fails to merge its inventory report without any indication to the user of the failure.

Normally, if you attempt to register an agent to a server with the same agent name or address, you receive an error message on the agent console or in the log that makes it clear what is wrong. But in this case, you do not.

You will receive an agent prompt and all agent prompt commands will fail with the same root exception:

        java.lang.IllegalStateException: The sender object is currently not sending commands now. Command not sent: [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.timeout=1800000, rhq.send-throttle=true}]; params=[{invocation=NameBasedInvocation[mergeInventoryReport], targetInterfaceName=org.rhq.core.clientapi.server.discovery.DiscoveryServerService}]]
            at org.rhq.enterprise.communications.command.client.ClientCommandSender.sendSynch(ClientCommandSender.java:631)
            at org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory$RemotePojoProxyHandler.invoke(ClientRemotePojoFactory.java:407)
            at $Proxy3.mergeInventoryReport(Unknown Source)
            at org.rhq.core.pc.inventory.InventoryManager.handleReport(InventoryManager.java:1047)
            at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.call(AutoDiscoveryExecutor.java:129)
            at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.run(AutoDiscoveryExecutor.java:91)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Start JBoss ON server.
2.  Start JBoss ON agent using agent name of `original-agent`.
3.  Verify agent is registered and its platform was discovered.
4.  Shutdown agent.
5.  Configure JBoss ON agent for auto-install by updating the following properties in ${RHQ_AGENT_HOME}/conf/agent-configuration.xml:

-               <!--
-               <entry key="rhq.agent.configuration-setup-flag" value="false" />
-               -->
+               <entry key="rhq.agent.configuration-setup-flag" value="true" />

-               <!--
-               <entry key="rhq.agent.name" value="my.hostname.com"/>
-               -->
+               <entry key="rhq.agent.name" value="new-agent"/>

-               <entry key="rhq.agent.server-auto-detection" value="false" />
+               <entry key="rhq.agent.server-auto-detection" value="true" />

-               <entry key="rhq.communications.multicast-detector.enabled"              value="false" />
+               <entry key="rhq.communications.multicast-detector.enabled"              value="true" />

6.  Restart agent using the --cleanconfig command-line argument:

        cd "${RHQ_AGENT_HOME}/bin"
        ./rhq-agent.sh --cleanconfig
7.  Execute agent prompt command ping.

Actual results:
Failed to execute prompt command [ping]. Cause: java.lang.IllegalStateException:The sender object is currently not sending commands now. Command not sent: [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.send-throttle=true}]; params=[{invocation=NameBasedInvocation[ping], targetInterfaceName=org.rhq.enterprise.communications.Ping}]]

Also, agent.log contains warnings and errors with the same IllegalStateException.

Expected results:
Before agent prompt is displayed and error or warning message indicating the agent is not yet communicating with a server or some other indication of why registration is failing.

Additional info:
This was originally reported in JBoss ON but the server auto-detection feature is not supported by JON so I am capturing this here.

Note You need to log in before you can comment on or make changes to this bug.