Bug 1410981

Summary: Running apply-updates.bat with agent as target attempts to run rhqctl upgrade --apply-fixes
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Upgrade, Launch ScriptsAssignee: Simeon Pinder <spinder>
Status: CLOSED ERRATA QA Contact: Sunil Kondkar <skondkar>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.7CC: skondkar, spinder
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.8   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 18:45:58 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:

Description Larry O'Leary 2017-01-07 05:07:37 UTC
Description of problem:
Running apply-updates on a Windows machine to update a standalone agent reports the update may have failed and logs the following exception:

       Unexpected error:D:\rhq-agent\jbossas\standalone\configuration\standalone-full.xml (The system cannot find the path specified)
java.io.FileNotFoundException: D:\rhq-agent\jbossas\standalone\configuration\standalone-full.xml (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileReader.<init>(Unknown Source)
        at org.rhq.prod.UpdateProperties.processSecureSocketProtocol(UpdateProperties.java:105)
        at org.rhq.prod.UpdateProperties.main(UpdateProperties.java:446)
         Unexpected error:D:\rhq-agent\bin\rhq-server.properties (The system cannot find the file specified)
java.io.FileNotFoundException: D:\rhq-agent\bin\rhq-server.properties (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileReader.<init>(Unknown Source)
        at org.rhq.prod.UpdateProperties.loadFileContents(UpdateProperties.java:285)
        at org.rhq.prod.UpdateProperties.processSecureSocketProtocol(UpdateProperties.java:157)
        at org.rhq.prod.UpdateProperties.main(UpdateProperties.java:446)


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

How reproducible:
Always

Steps to Reproduce:
1. Install 3.3.0 agent in C:\opt
2. Execute apply-update.bat C:\opt\rhq-agent

Actual results:
Console and update.log contains the following exception/error:

         Unexpected error:D:\rhq-agent\jbossas\standalone\configuration\standalone-full.xml (The system cannot find the path specified)
java.io.FileNotFoundException: D:\rhq-agent\jbossas\standalone\configuration\standalone-full.xml (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileReader.<init>(Unknown Source)
        at org.rhq.prod.UpdateProperties.processSecureSocketProtocol(UpdateProperties.java:105)
        at org.rhq.prod.UpdateProperties.main(UpdateProperties.java:446)
         Unexpected error:D:\rhq-agent\bin\rhq-server.properties (The system cannot find the file specified)
java.io.FileNotFoundException: D:\rhq-agent\bin\rhq-server.properties (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileReader.<init>(Unknown Source)
        at org.rhq.prod.UpdateProperties.loadFileContents(UpdateProperties.java:285)
        at org.rhq.prod.UpdateProperties.processSecureSocketProtocol(UpdateProperties.java:157)
        at org.rhq.prod.UpdateProperties.main(UpdateProperties.java:446)

Expected results:
No failure and update is applied.

Additional info:
The issue here is that the :success block of the script always applies additional server configuration regardless of the target type.

Comment 5 Sunil Kondkar 2017-01-31 16:12:02 UTC
Verified on JON 3.3.8 ER02 build

Installed 3.3.0 standalone agent on Windows machine and applied the JON 3.3.8 update with standalone agent as target. The update is successful. There are no errors in console and in update.log

Comment 6 errata-xmlrpc 2017-02-16 18:45:58 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