glassfish
  1. glassfish
  2. GLASSFISH-17858

Failed start-instance on SSH reports "null" for command executed.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2_dev
    • Fix Version/s: 3.1.2_dev, 4.0
    • Component/s: admin
    • Labels:
      None

      Description

      I ran 3.1.2 B10 start-instance on a setup that failed, and it reported an error like this:

      Could not start instance i1 on node node1 (10.132.181.201).: Command 'null' failed on node node1 (10.132.181.201):

      Note that instead of displaying the command that was run, it is displaying "null". This correctly displayed the command in 3.1.1, so it is a regression.

        Activity

        Hide
        Joe Di Pol added a comment -

        Looks like this was caused when the NodeRunner code was refactored to support DCOM. Specifically in NodeRunner, "lastCommandRun" is never set when a remote command is executed using SSH. We need to propogate lastCommandRun from NodeRunnerSSH to NodeRunner.

        Show
        Joe Di Pol added a comment - Looks like this was caused when the NodeRunner code was refactored to support DCOM. Specifically in NodeRunner, "lastCommandRun" is never set when a remote command is executed using SSH. We need to propogate lastCommandRun from NodeRunnerSSH to NodeRunner.
        Hide
        Joe Di Pol added a comment -

        Fixed in 3.1.2 branch (r51215) and trunk (r51219)

        Project:    glassfish
        Repository: svn
        Revision:   51215
        Author:     jfdipol
        Date:       2011-11-30 23:16:22 UTC
        Link:       
        
        Log Message:
        ------------
        Fix 17858 Failed start-instance on SSH reports "null" for command executed
        
        Also fix missing parameter on another message.
        
        
        
        
        Revisions:
        ----------
        51215
        
        
        Modified Paths:
        ---------------
        branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java
        branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java
        branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java
        
        
        Diffs:
        ------
        Index: branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java
        ===================================================================
        --- branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java	(revision 51214)
        +++ branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java	(revision 51215)
        @@ -499,7 +499,7 @@
                                     m1, m2));
                     }
                     else {
        -                String msg = Strings.get("ssh.bad.connect", nodehost);
        +                String msg = Strings.get("ssh.bad.connect", nodehost, "SSH");
                         logger.warning(StringUtils.cat(": ", msg, m1, m2,
                                 sshL.toString()));
                         throw new CommandValidationException(StringUtils.cat(NL,
        Index: branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java
        ===================================================================
        --- branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java	(revision 51214)
        +++ branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java	(revision 51215)
        @@ -220,7 +220,9 @@
         
                 if ("SSH".equals(type)) {
                     NodeRunnerSsh nrs = new NodeRunnerSsh(habitat, logger);
        -            return nrs.runAdminCommandOnRemoteNode(node, output, args, stdinLines);
        +            int result = nrs.runAdminCommandOnRemoteNode(node, output, args, stdinLines);
        +            lastCommandRun = nrs.getLastCommandRun();
        +            return result;
                 }
         
                 if ("DCOM".equals(type)) {
        Index: branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java
        ===================================================================
        --- branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java	(revision 51214)
        +++ branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java	(revision 51215)
        @@ -84,6 +84,9 @@
                 return node.getType().equals("SSH");
             }
         
        +    String getLastCommandRun() {
        +        return lastCommandRun;
        +    }
         
             public int runAdminCommandOnRemoteNode(Node node, StringBuilder output,
                                                List<String> args,
        
        
        Show
        Joe Di Pol added a comment - Fixed in 3.1.2 branch (r51215) and trunk (r51219) Project: glassfish Repository: svn Revision: 51215 Author: jfdipol Date: 2011-11-30 23:16:22 UTC Link: Log Message: ------------ Fix 17858 Failed start-instance on SSH reports "null" for command executed Also fix missing parameter on another message. Revisions: ---------- 51215 Modified Paths: --------------- branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java Diffs: ------ Index: branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java =================================================================== --- branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java (revision 51214) +++ branches/3.1.2/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java (revision 51215) @@ -499,7 +499,7 @@ m1, m2)); } else { - String msg = Strings.get("ssh.bad.connect", nodehost); + String msg = Strings.get("ssh.bad.connect", nodehost, "SSH"); logger.warning(StringUtils.cat(": ", msg, m1, m2, sshL.toString())); throw new CommandValidationException(StringUtils.cat(NL, Index: branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java =================================================================== --- branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java (revision 51214) +++ branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunner.java (revision 51215) @@ -220,7 +220,9 @@ if ("SSH".equals(type)) { NodeRunnerSsh nrs = new NodeRunnerSsh(habitat, logger); - return nrs.runAdminCommandOnRemoteNode(node, output, args, stdinLines); + int result = nrs.runAdminCommandOnRemoteNode(node, output, args, stdinLines); + lastCommandRun = nrs.getLastCommandRun(); + return result; } if ("DCOM".equals(type)) { Index: branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java =================================================================== --- branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java (revision 51214) +++ branches/3.1.2/cluster/ssh/src/main/java/org/glassfish/cluster/ssh/connect/NodeRunnerSsh.java (revision 51215) @@ -84,6 +84,9 @@ return node.getType().equals("SSH"); } + String getLastCommandRun() { + return lastCommandRun; + } public int runAdminCommandOnRemoteNode(Node node, StringBuilder output, List<String> args,

          People

          • Assignee:
            Joe Di Pol
            Reporter:
            Joe Di Pol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: