scheduling icon indicating copy to clipboard operation
scheduling copied to clipboard

SSHInfrastructure deployment is not working on Windows

Open laurentpellegrino opened this issue 9 years ago • 2 comments

We have tried to setup SSH Infrastructure deployment on Windows from a Linux machine. In other words, the Scheduler is running on a Linux machine (trydev) and the nodes are expected to be deployed on a Windows machine (Amazon EC2 VM).

ProActive version used was 7.6.0-20160311-0511-SNAPSHOT.

SSH access from the Linux machine that runs the Scheduler was configured to connect the Windows machine using SSH keys. The new Win32-OpenSSH binary provided by Microsoft was used. Below is a link to some notes that describe how installation was performed:

https://docs.google.com/a/activeeon.com/document/d/1JZXc6WYI2_QLDcsBfzVQEYXNPwTtaTpfoVSdGqleRg0/edit?usp=sharing

SSHInfrastructureV2 was used and configured from the RM Web portal. TargetOS was set to Windows. When the OK button is pressed, the deployment is started but fails. Hereafter is the output:

URL:    deploying://Windows2/SSH-Windows2-33
Source: Windows2
Host:    
Status: Lost since Fri Mar 11 12:04:11 GMT+100 2016, 1h19mn ago
Provider:   pellegrino
Used by:     
JVM:     
Description:    
Node SSH-Windows2-33
URL : deploying://Windows2/SSH-Windows2-33
Node source : Windows2
Provider : pellegrino
State : Lost
Description : Unable to deploy on /52.50.80.192 due to java.lang.IllegalStateException: The jvm process of the node has exited prematurely
 > Process exit code: 0
 > Process output: 
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
                  The default VM is server.

    -cp 
    -classpath 
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D=
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:...|:]
    -enableassertions[:...|:]
                  enable assertions with specified granularity
    -da[:...|:]
    -disableassertions[:...|:]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:[=]
                  load native agent library , e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:[=]
                  load native agent library by full pathname
    -javaagent:[=]
                  load Java programming language agent, see java.lang.instrument
    -splash:
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

Command : C:\Users\Administrator\Downloads\PWS\jre\bin\java.exe -Dproactive.home=C:\Users\Administrator\Downloads\PWS -Djava.security.policy=C:\Users\Administrator\Downloads\PWS\config\security.java.policy-client -Dlog4j.configuration=file:/C:/Users/Administrator/Downloads/PWS/config/log/node.properties -Dfile.encoding=UTF-8 -cp .;C:\Users\Administrator\Downloads\PWS\addons;C:\Users\Administrator\Downloads\PWS\addons\*;C:\Users\Administrator\Downloads\PWS\dist\lib\* org.ow2.proactive.resourcemanager.utils.RMNodeStarter -v [OBFUSCATED_CRED] -n SSH-Windows2-33 -s Windows2 -r pamr://4096/ -w 1

According to the output SSH connection has succeeded but not the execution of the command to spawn the JVM that starts the nodes.

Below is the full command from the Server logs:

[2016-03-11 12:04:10,051 INFO  .o.p.r.n.i.SSHInfrastructureV2] Executing SSH command: 'C:\Users\Administrator\Downloads\PWS\jre\bin\java.exe -Dproactive.home=C:\Users\Administrator\Downloads\PWS -Djava.security.policy=C:\Users\Administrator\Downloads\PWS\config\security.java.policy-client -Dlog4j.configuration=file:/C:/Users/Administrator/Downloads/PWS/config/log/node.properties -Dfile.encoding=UTF-8 -cp .;C:\Users\Administrator\Downloads\PWS\addons;C:\Users\Administrator\Downloads\PWS\addons\*;C:\Users\Administrator\Downloads\PWS\dist\lib\* org.ow2.proactive.resourcemanager.utils.RMNodeStarter -v UlNBCjEwMjQKUlNBL0VDQi9QS0NTMVBhZGRpbmcKX/jK2flOq+sE9+deliberately_shorten+EfGPqcwKy3/NMQ= -n SSH-Windows2-34 -s Windows2 -r pamr://4096/ -w 1'

If the command from the previous output is used directly on a Powershell opened from the Windows machine, then no problem occurs: the command runs properly. We suspect that JSCH changes the encoding of the command or escapes something.

laurentpellegrino avatar Mar 11 '16 12:03 laurentpellegrino

I have performed a new test by installing Cygwin. The same kind of problem occurs. It affects SSHInfrastructure and SSHInfrastructureV2.

The command executed by the Scheduler through SSH on the Windows machine is the following:

Executing SSH command: '/home/Administrator/PWS/jre/bin/java.exe -Dproactive.home=/home/Administrator/PWS -Djava.security.policy=/home/Administrator/PWS/config/security.java.policy-client -Dlog4j.configuration=file:/home/Administrator/PWS/config/log/node.properties -Dfile.encoding=UTF-8 -cp .;/home/Administrator/PWS/addons;/home/Administrator/PWS/addons/*;/home/Administrator/PWS/dist/lib/* org.ow2.proactive.resourcemanager.utils.RMNodeStarter -v UlNBCjEwMjQKUlNBL0VDQi9QS0NTMVBhZGRpbmcKVM2PNz/ct0w3uVLvx1bBn0wxkTvmHMyvkNbpS2XbJqAOckktzTA+lFuQrQuKoM27lvGhIXADINnHPM24Iw1VfUirTBAImOtdL+D/OWxDHz9XqirXua869pYZD5CTjqcRWhq75FXPJiTZpBNsDeIabAOZdwFpVJm566iWC2jcIH6rSaXYyBEO55gIqqG52hYFrdWEs7qljwuMggtz1kJSBaPpDu49vOJAP/Slw9gDSUBhD1+DoFHE5WNIyQdLcnObFgwHNBcSRHVnRBKCpVSBsX03lZjlQT9iW5x/6qsEIv/Wu3rqj/CTHKkqGZ7tR9+YcMlwye9QfCcWLcWR+EIU3l3mjRr2ODJJ/cqmoqVOHpCXHyCHNvxxN1ark8fSJfxx02iyxqklSIBluFeuNLSG3PfuDm9b5xZR3OcvZe9FB5IJdAhgBy2rVVCHja8MqPsawFP9G+GKMXGekS/QWTv14ncrRxqCtiArAU2EJ7sYvfNNhyy0ef0hAUoN2ylcPU8cEyzurPy00diqwBisIjrN10eDP8Y4i1LAS+3A7p2yJ2E= -n SSH-WinCygWin-10 -s WinCygWin -r pamr://4096/ -w 1'

TargetOS parameter value was set to Cygwin.

The output of the command is the following:

 Declaring node as lost: deploying://WinCygWin/SSH-WinCygWin-4, Unable to deploy on /52.50.80.192 due to java.lang.IllegalStateException: The jvm process of the node has exited prematurely
 > Process exit code: 2
 > Process output: 
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
bash: /home/Administrator/PWS/addons: Is a directory
/home/Administrator/PWS/addons/MatlabWorkerConfiguration.xml: line 1: syntax error near unexpected token `newline'
/home/Administrator/PWS/addons/MatlabWorkerConfiguration.xml: line 1: `<?xml version="1.0" encoding="ISO-8859-15"?>'
/home/Administrator/PWS/dist/lib/FastInfoset-1.2.12.jar: line 1: $'PK\003\004': command not found
/home/Administrator/PWS/dist/lib/FastInfoset-1.2.12.jar: line 2: H_%?: command not found
/home/Administrator/PWS/dist/lib/FastInfoset-1.2.12.jar: line 3: syntax error near unexpected token `)'
/home/Administrator/PWS/dist/lib/FastInfoset-1.2.12.jar: line 3: G_%?�>�
                                                                        �META-INF/MANIFEST.MFu��j�0����ۃ�ؤ%�-  )�4MI��[���ec�Ɓ>|���%יog�ݵ�:C��k�K+ �J��u����l�k|�,k�S�8  �WRk٢�d�h�?�������=��~�-��F7��:���gO�@�,�k,�'

This time it looks like the command is not correctly built. Most probably an escaping issue and/or an encoding issue with the credentials.

laurentpellegrino avatar Mar 13 '16 07:03 laurentpellegrino

Classpath parameter needs to be escaped, it looks like this is the issue here, otherwise wild cards will be expanded by the Cygwin shell

fviale avatar Mar 13 '16 10:03 fviale