Bug 1087504

Summary: JON fails to start autodetected EAP 5.3 (on Windows) with exception: incorrect command syntax, input line is too long
Product: [JBoss] JBoss Operations Network Reporter: Radim Hatlapatka <rhatlapa>
Component: Plugin -- JBoss EAP 5Assignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED WORKSFORME QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: loleary, myarboro, rhatlapa, tsegismo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1119860 (view as bug list) Environment:
Windows
Last Closed: 2015-01-09 23:49:25 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:    
Bug Blocks: 1119860    
Attachments:
Description Flags
Test class to reproduce issue none

Description Radim Hatlapatka 2014-04-14 13:30:42 UTC
Description of problem:
When starting EAP 5.3 from JON (it was imported via discovery queue after manual autodetection), it fails with [1]

Version-Release number of selected component (if applicable): EAP 5.3.0.ER3 vs JON 3.2.0


How reproducible: always


Steps to Reproduce:
1. start EAP 5 and import it from discovery queue
2. stop the EAP 5 from JON server
3. start the EAP 5 from JON server

Actual results: fails with [1]


Expected results: successfully started


Additional info: for Oracle JDK 1.7 it works with EAP 5.2


[1] java.lang.Exception: The server failed to start: The input line is too long. The syntax of the command is incorrect. at org.rhq.core.pc.operation.OperationInvocation.run(OperationInvocation.java:278) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

Comment 1 Radim Hatlapatka 2014-04-14 13:34:37 UTC
This issue is very similar to BZ#1087422 but for Windows there are some other information about input line being too long.

Note that windows command line is limited to 8191 characters, so this could be related to this limit, see [1]

[1] http://support.microsoft.com/kb/830473

Comment 2 Thomas Segismont 2014-04-24 15:37:21 UTC
Could not reproduce with EAP 5.3.ER3, JON 3.2GA on Windows 2008 server

EAP 6.3 is auto discovered and the stop and start operations work as expected.

Comment 6 Thomas Segismont 2014-04-25 08:50:49 UTC
I tried again to reproduce on my Windows 2008 with EAP installed in a directory similar to the directory used for test automation:
C:\workspace\eap5-jon-plugin-windows\a28e18c8\eap5unsecured\jboss-eap-5.3\jboss-as

The stop/start sequence works.

On the server resource "Connection Settings" tab, what is the value of your "Start script" property? Mine is empty so the "start" operation uses the default value.

Comment 7 Radim Hatlapatka 2014-04-25 09:27:58 UTC
The Start script is filled in my case by the discovery process

Comment 8 Thomas Segismont 2014-04-25 13:10:38 UTC
I tried again with the "Start script" property set to the script absolute path and it still works.

Can you please build an environment where I can reproduce this bug? The only environment where this problem shows up is a Jenkins slave and the project workspace is cleared after the suite is executed.

Before that happens, I can't see what else I can do.

Comment 12 Thomas Segismont 2014-04-30 14:12:59 UTC
Created attachment 891196 [details]
Test class to reproduce issue

Comment 13 Thomas Segismont 2014-04-30 14:44:33 UTC
I eventually managed to reproduce the issue on a Windows 2008R2 box with a test class (attachment 891196 [details]).

The problem is that EAP5.3 needs the "OS" environment variable to be set:
== line 9
@if "%OS%" == "Windows_NT" setlocal enableextensions enabledelayedexpansion
==

If it is not set, the script goes in infinite loop here:
== line 22
:LoopArgs
for /f "usebackq tokens=1,*" %%A in ('!params!') do (
==

After some time, the cmd process ends with error message "Input line is too long"

JON team needs to update the EAP5 server discovery class (add the "OS" environment variable to the list of discovered env properties).

Comment 14 Thomas Segismont 2014-04-30 19:32:17 UTC
I had a look at the EAP5 server discovery class, the environment variables discovery process relies on the ServerStartScriptDiscoveryUtility class. And ServerStartScriptDiscoveryUtility actually looks up for the "OS" variable.

That's why it worked for me on Windows 2008 (see comment 2).

So now we need to understand why on your QE box the variable is not discovered. How do you start the EAP5.3 server process before discovery? Via Cygwin? Do you by accident start run.sh instead of run.bat?

Comment 15 Radim Hatlapatka 2014-05-05 08:22:56 UTC
It is started using run.bat via CMD. [1] this is the precise command used, first part of the command is a way to start the process and assigning it an identifier useful for PID detection.

Note, both EAP 5.2 and 5.3 are started the same way.


[1] cmd /C start "1776016263" /min run.bat -c default -b localhost

Comment 18 Thomas Segismont 2014-09-02 12:41:33 UTC
I tried again this morning and could not reproduce (on a Windows 2008R2 machine).

The only thing I can imagine is that, for some reason, the process environment cannot be determined. This could be because the RHQ Agent is running as a user without the required privilege.

Which user are your running on:
* the RHQ agent?
* the EAP 5.3 instance?

Can you attach the agent log at DEBUG level?

Comment 24 Larry O'Leary 2015-01-09 23:49:25 UTC
As there is insufficient data on this and it is not clear if this is even a bug and was only reported against an unreleased product, I am marking this as WORKSFORME.