Bug 847853 - After I uninventory platform, agent disconnects
After I uninventory platform, agent disconnects
Product: RHQ Project
Classification: Other
Component: Agent (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2012-08-13 14:59 EDT by Libor Zoubek
Modified: 2015-11-01 19:43 EST (History)
3 users (show)

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

Attachments (Terms of Use)
agent settings - broken agent (7.89 KB, text/xml)
2012-08-13 14:59 EDT, Libor Zoubek
no flags Details
agent settings - after clean setup (3.90 KB, text/xml)
2012-08-13 14:59 EDT, Libor Zoubek
no flags Details

  None (edit)
Description Libor Zoubek 2012-08-13 14:59:11 EDT
Created attachment 604072 [details]
agent settings - broken agent

Description of problem: I was having issues with uninventorying platforms in Bug 830158 so I developed a safe way to uninvenory platform. First I uninventory all its children and then I uninventory platform itself.

When I do that (without reproducing Bug 830158) agent disappears. In agent.log I start getting 

The server has rejected the agent registration request. Cause: [org.rhq.core.clientapi.server.core.AgentRegistrationException:Server cannot ping the agent's endpoint. The agent's endpoint is probably invalid or there is a firewall preventing the server from connecting to the agent. Endpoint: socket://null:16163/?rhq.communications.connector.rhqtype=agent&null]
Will retry the agent registration request soon...

If I restart agent (using SSH on server) I am getting this:

2012-08-13 20:00:04,535 FATAL [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.start-failure}Failed to start the agent
java.lang.RuntimeException: Error setting up server invoker SocketServerInvoker[UNINITIALIZED]
        at org.jboss.remoting.ServerInvoker.create(ServerInvoker.java:854)
        at org.jboss.remoting.transport.Connector.init(Connector.java:411)
        at org.jboss.remoting.transport.Connector.create(Connector.java:815)
        at org.rhq.enterprise.communications.ServiceContainer.setupServerConnector(ServiceContainer.java:1216)
        at org.rhq.enterprise.communications.ServiceContainer.start(ServiceContainer.java:550)
        at org.rhq.enterprise.communications.ServiceContainer.start(ServiceContainer.java:468)
        at org.rhq.enterprise.agent.AgentMain.startCommServices(AgentMain.java:2325)
        at org.rhq.enterprise.agent.AgentMain.start(AgentMain.java:652)
        at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:428)
Caused by: java.net.UnknownHostException: null
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:867)
        at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1246)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1197)
        at java.net.InetAddress.getAllByName(InetAddress.java:1128)
        at java.net.InetAddress.getAllByName(InetAddress.java:1064)
        at java.net.InetAddress.getByName(InetAddress.java:1014)
        at org.jboss.remoting.ServerInvoker.setup(ServerInvoker.java:1019)
        at org.jboss.remoting.transport.socket.SocketServerInvoker.setup(SocketServerInvoker.java:157)
        at org.jboss.remoting.ServerInvoker.create(ServerInvoker.java:850)
        ... 8 more

It looks like agent some configuration properties get deleted. The only way to recover from this state is to run rhq-agent.sh -L and setup agent again. See prefs.xml (after this issue occured) and prefx.default.xml (agent was setup recentlly) attachements.

Version-Release number of selected component (if applicable):
JON 3.1.1.ER1

How reproducible:hard/random

Steps to Reproduce:
1. Import platform with children
2. Uninventory children one by one
3. Uninventory platform

Additional info:
Comment 1 Libor Zoubek 2012-08-13 14:59:48 EDT
Created attachment 604073 [details]
agent settings - after clean setup
Comment 2 Larry O'Leary 2012-08-20 12:43:00 EDT
This is due to the feature introduced by Bug 535246 to de-register the agent when the agent's platform resource is removed from inventory.
Comment 3 mark yarborough 2012-11-20 15:45:38 EST
Per triage with loleary, crouch, mfoley: Move to JBoss ON product, set target release JON 3.2, clear priority (will be subject to further triage in JON 3.2 timeframe).
Comment 4 Larry O'Leary 2012-11-21 19:21:09 EST
This is not a bug. This is how agent de-registration works. You remove the platform (agent) from inventory, and the agent is no longer registered with the server and requires re-configuration.

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