Bug 828568

Summary: [gui] attempting to create a child Resource when the corresponding Agent is not running results in an exception + stack trace
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: Core UIAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: high    
Version: 4.4CC: ccrouch, fbrychta, hbrock, hrupp, jsanda
Target Milestone: ---   
Target Release: JON 3.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 822299 Environment:
Last Closed: 2013-09-03 15:13:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 822299    
Bug Blocks:    

Comment 1 Charles Crouch 2012-06-04 22:06:27 UTC
This is for fixing this bug in JON3.1.1 once a branch is available.

Comment 2 John Sanda 2012-07-20 14:43:45 UTC
Pushed commits to release/jon3.1.x branch to provide better error reporting when agent is unreachable.

commit hash: 65db439bacb2
commit hash: b02bb857d8

Comment 3 John Sanda 2012-08-02 18:52:06 UTC
JON 3.1.1 ER1 build is available. Moving to ON_QA.

https://brewweb.devel.redhat.com/buildinfo?buildID=226942

Comment 4 Filip Brychta 2012-08-03 15:28:57 UTC
Tested on JON 3.1.1 ER1. Verifired for creating and deleting child resource. Failed for manual import. Scenario: 
1- the agent is down 
2- import some resource from discovery queue

result:
GUI message: You have successfully imported the selected Resources.
server log: 
2012-08-03 17:19:29,095 ERROR [org.rhq.enterprise.communications.command.client.ClientCommandSenderTask] {ClientCommandSenderTask.send-failed}Failed to send command [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.send-throttle=true}]; params=[{invocation=NameBasedInvocation[synchronizeInventory], targetInterfaceName=org.rhq.core.clientapi.agent.discovery.DiscoveryAgentService}]]. Cause: org.jboss.remoting.CannotConnectException:Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://localhost:16163/?backlog=200&clientMaxPoolSize=304&enableTcpNoDelay=true&maxPoolSize=303&numAcceptThreads=1&rhq.communications.connector.rhqtype=agent&socketTimeout=60000] -> java.net.ConnectException:Connection refused. Cause: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://localhost:16163/?backlog=200&clientMaxPoolSize=304&enableTcpNoDelay=true&maxPoolSize=303&numAcceptThreads=1&rhq.communications.connector.rhqtype=agent&socketTimeout=60000]

expected result:
the same behaviour as for creating/removing children. No error stack trace, notify user that agent is unreachable.

Comment 5 John Sanda 2012-08-14 18:57:41 UTC
When you import resources from the discovery job, a Quartz job gets scheduled to notify the agent of the inventory status changes. That quartz job runs asynchronously in the background. The error message listed in comment 4 comes from that Quartz job. There currently is no way to report errors that happen in a background task to the web client. This is a great use case for using something like Errai where we want to push a notification from the server to the client.

I am going to move this back to ON_QA and suggest that the notification for error on manual import from discovery queue be logged as a separate feature request.

Comment 6 John Sanda 2012-08-14 19:33:45 UTC
I have created bug 848167 as a RFE to add support for sending notifications to the UI for things that happen out of band.

Comment 7 Heiko W. Rupp 2013-09-03 15:13:13 UTC
Bulk closing of old issues in VERIFIED state.