Created attachment 935657 [details] eap_script_error_code_windows Description of problem: eap cli script does not get correct result code for eap domain server on windows Version-Release number of selected component (if applicable): JON 3.3 ER02 How reproducible: always Steps to Reproduce: 1. run eap script on domain server on windows that should fail 2. run (the same) eap script on domain server on linux that should fail Actual results: after step1. no error code in result after step2. error code 1 in reulst Expected results: Additional info: screen-shots attached feedback from Radmin H. rhatlapa> I think it is caused by JON that it doesn't provde NOPAUSE env variable resulting in the script not really ending
Created attachment 935658 [details] eap_script_error_code_linux
Fixed in master commit 24713c78326a2f1b0d6df7199151266745bcf7f9 Author: Thomas Segismont <tsegismo> Date: Thu Sep 11 17:02:43 2014 +0200 Bug 1139684 - eap cli script does not get correct result code for eap domain server on windows When running the CLI on Windows, make sure no "pause" message is shown after script execution Otherwise the CLI process will just keep running so we'll never get the exit code
Cherry-picked over to release/jon3.3.x commit 9c88c59b63b465c117fdb717e64e0c7e666aadb9 Author: Thomas Segismont <tsegismo> Date: Thu Sep 11 17:02:43 2014 +0200 Bug 1139684 - eap cli script does not get correct result code for eap domain server on windows When running the CLI on Windows, make sure no "pause" message is shown after script execution Otherwise the CLI process will just keep running so we'll never get the exit code (cherry picked from commit 24713c78326a2f1b0d6df7199151266745bcf7f9) Signed-off-by: Thomas Segismont <tsegismo>
Moving to ON_QA as available for test with the following brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=385149
the issue is still visible cli command to use: /subsystem=logging:read-operation-names /subsystem=datasources:read-operation-names returns exit code 1 for eap domain in linux and passes for eap domain in windows re-assigning
C:\Users\Administrator\Downloads\jboss-eap-6.2\bin>jboss-cli.bat --connect --file=test.cli JBAS014808: Child resource '"subsystem" => "datasources"' not found C:\Users\Administrator\Downloads\jboss-eap-6.2\bin>echo Exit Code is %errorlevel% Exit Code is 1 C:\Users\Administrator\Downloads\jboss-eap-6.2\bin>cmd /C jboss-cli.bat --connect --file=test.cli JBAS014808: Child resource '"subsystem" => "datasources"' not found C:\Users\Administrator\Downloads\jboss-eap-6.2\bin>echo Exit Code is %errorlevel% Exit Code is 0 Great... the errorlevel is 0 when you call the CLI with "CMD /C", which is mandatatory for JON as you can't call a batch file directly, you need to invoke the "CMD" executable.
So the issue seems to be that the jboss-cli.bat script should end with something like: ======= if ERRORLEVEL 1 exit /B 1 ======= With a modified EAP script on my Windows 2008 machine, I get: ======= C:\Tools\jboss-eap-6.2\bin>cmd /C jboss-cli.bat --connect --commands=dsq Unexpected command 'dsq'. Type 'help --commands' for the list of supported commands. C:\Tools\jboss-eap-6.2\bin>echo %errorlevel% 1 ======= We should open a BZ against EAP6 but I must find a workaround because, with this bug, EAP CLI script execution from JON (as operation or bundle handover) is not reliable on Windows.
Fixed in master commit 62b5a80761270d3b8a16e2899383d890feeca272 Author: Thomas Segismont <tsegismo> Date: Fri Sep 19 14:07:18 2014 +0200 This is due to "WFLY-3578 jboss-cli.bat always exits with return code 0 even after a cli failure" https://issues.jboss.org/browse/WFLY-3578 Added jboss-cli-wrapper.bat Calling "cmd /c jboss-cli.bat" will always return 0 even if an error occurs in the CLI Calling it through the wrapper solves the issue Side work: * fix standalone and domain startup: start script prefix, if set, was not added * when an error occurs, execute command and execute script operations now copy process output into the operation result instead of the error message * some code cleanup (avoid possible NPE)
release/jon3.3.x commit 96481d79219356f4083656d0c496fc42081533ae Author: Thomas Segismont <tsegismo> Date: Fri Sep 19 14:07:18 2014 +0200 (cherry picked from commit 62b5a80761270d3b8a16e2899383d890feeca272) Signed-off-by: Jay Shaughnessy <jshaughn>
Moving to ON_QA as available for test with build: https://brewweb.devel.redhat.com/buildinfo?buildID=388959
Created attachment 944273 [details] cli_error_code_windows
verified in JON 3.3 ER04