Bug 1302800

Summary: Remote agent auto upgrade failed when sslsocket encryption enabled
Product: [JBoss] JBoss Operations Network Reporter: Jeeva Kandasamy <jkandasa>
Component: Agent, UpgradeAssignee: Josejulio Martínez <jmartine>
Status: CLOSED ERRATA QA Contact: Filip Brychta <fbrychta>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.6CC: fbrychta, jmartine, loleary, spinder
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 18:44:45 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:
Attachments:
Description Flags
summary
none
complete report none

Description Jeeva Kandasamy 2016-01-28 16:31:34 UTC
Created attachment 1119192 [details]
summary

Description of problem:
Remote agent auto upgrade failed when sslsocket encryption(only) enabled. Upgrade test performed from JON 3.3.0 GA to JON 3.3.5 CR01. Local agent upgraded successfully. But remote agent failed to upgrade

from agent.log(remote agent):
-----------------------------
2016-01-28 09:55:54,572 FATAL [RHQ Agent Update Thread] (org.rhq.enterprise.agent.AgentUpdateThread)- {PromptCommand.update.download-failed}Failed to download the agent update binary. Cause: Unexpected end of file from server


Version-Release number of selected component (if applicable):
JON 3.3.5 CR01
Version : 3.3.0.GA Update 05
Build Number : 4242930:1c9f74b
GWT Version : 2.5.0
SmartGWT Version : 3.0p

How reproducible:
always

Steps to Reproduce:
1. Enable sslscoket encryption only mode on server and agent in the version JON 3.3.0 GA. Follow https://bugzilla.redhat.com/show_bug.cgi?id=1302322
2. Upgrade Server to JON 3.3.5 CR01 version(local agent will be upgraded along with server upgrade)
3. Remote agent will upgraded once server comes up. In this setup remote agent failed to upgrade and throws error mentioned above.
4. Restarted agent manually. say upgrading/done but often seeing the message "(org.rhq.enterprise.agent.AgentShutdownHook)- {AgentShutdownHook.wait}The agent will wait for [9] threads to die", after certain timeout agent get shutdown by "(org.rhq.enterprise.agent.AgentShutdownHook)- {AgentShutdownHook.no-more-wait}[8] threads are not dying - agent will not wait anymore"

Actual results:
remote agent auto upgrade not successful when sslsocket encryption(only) enabled.

Expected results:
remote auto upgrade should happen successfully.

Additional info:

Server and agent log files are attached

Comment 1 Jeeva Kandasamy 2016-01-28 16:32:06 UTC
Created attachment 1119193 [details]
complete report

Comment 4 Josejulio Martínez 2016-02-17 18:07:35 UTC
After checking the code and getting info on it, turns out that when using sslsocket you need to set these properties on the agent configuration:

  rhq.agent.agent-update.version-url - The agent-update servlet's url for the version.
  rhq.agent.agent-update.download-url - The agent-update servlet's url for the download.
 
By default the URL is http(s)://ip_or_host:port/agentupdate/version and http(s)://ip_or_host:port/agentupdate/download
 
e.g. in agent-configuration.xml
	...
	<entry key="rhq.agent.agent-update.version-url" value="https://10.0.1.11:7443/agentupdate/version"/>
	<entry key="rhq.agent.agent-update.download-url" value="https://10.0.1.11:7443/agentupdate/download"/>
	...
	
Note: on step 1.g of https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Operations_Network/3.3/html/Admin_and_Config/configuring-ssl.html
  If you are using sslsocket, the secure port has to be different than the sslsocket port.

Exit the agent and restart it, using the --cleanconfig option to load the new configuration.
  agentRoot/rhq-agent/bin/rhq-agent.sh --cleanconfig

Comment 14 Josejulio Martínez 2016-06-13 15:02:51 UTC
commit e182c36d81289d0c96cdafcfff6ead66df93cea5
Merge: 1d73d1e 7daa7fd
Author: Michael Burman <yak>
Date:   Sat Jun 11 11:16:12 2016 +0300

    Merge pull request #256 from josejulio/bugs/1302800
    
    Bug 1302800 - Remote agent auto upgrade failed when sslsocket encrypt…


commit 7daa7fd320b32127fabc21fe2d596d4df708390c
Author: Josejulio Martínez <jmartine>
Date:   Mon May 23 12:56:06 2016 -0500

    Bug 1302800 - Remote agent auto upgrade failed when sslsocket encryption enabled
    
      Added new server service to send the public agent update endpoint address.

Comment 16 Simeon Pinder 2016-07-07 08:23:03 UTC
Moving to ON_QA as available to test with the following build:
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=502442

Note: 	jon-server-patch-3.3.0.GA.zip maps to JON 3.3.6(jon-server-3.3.0.GA-update-06.zip)

Comment 23 errata-xmlrpc 2017-02-16 18:44:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2017-0285.html