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
Summary: Agent registration silently fails if server auto-detection and multicast is e...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-10 21:45 UTC by Larry O'Leary
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Larry O'Leary 2013-09-10 21:45:07 UTC
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):
4.4.0

How reproducible:
Always

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:
Pinging...
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.