{"record":{"id":"a7526b13f75e562d","repo":"pentaho/pentaho-kettle","slug":"ssh-error-messageempty","errorCode":"SSH.Error.MessageEmpty","errorMessage":"SSH.Error.MessageEmpty","messagePattern":"SSH\\.Error\\.MessageEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/ssh/SSH.java","lineNumber":120,"sourceCode":"\n    RowMetaInterface imeta = getInputRowMeta();\n    if ( imeta == null ) {\n      imeta = new RowMeta();\n      this.setInputRowMeta( imeta );\n    }\n    // Reserve room\n    Object[] rowData = new Object[ data.nrOutputFields ];\n    for ( int i = 0; i < data.nrInputFields; i++ ) {\n      rowData[ i ] = row[ i ]; // no data is changed, clone is not needed here.\n    }\n    int index = data.nrInputFields;\n\n    try {\n      if ( meta.isDynamicCommand() ) {\n        // get commands\n        data.commands = data.outputRowMeta.getString( row, data.indexOfCommand );\n        if ( Utils.isEmpty( data.commands ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"SSH.Error.MessageEmpty\" ) );\n        }\n      }\n\n      // Connect if not already connected\n      if ( !data.isConnected() ) {\n        data.getSshConnection().connect();\n        data.setConnected( true );\n        if ( log.isDebug() ) {\n          logDebug( BaseMessages.getString( PKG, \"SSH.Log.SessionOpened\" ) );\n        }\n      }\n\n      // execute commands\n      if ( log.isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"SSH.Log.RunningCommand\", data.commands ) );\n      }\n      ExecResult execResult = data.getSshConnection().exec( data.commands );\n","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/ssh/SSH.java#L102-L138","documentation":"The SSH step throws SSH.Error.MessageEmpty when the step is configured to take its SSH command from a field in the incoming row (dynamic command), but the value read from that field is empty or null. The step refuses to execute an empty command because there is nothing to send to the remote host. It is thrown from processRow before any connection is established.","triggerScenarios":"Running the SSH step with 'Execute command from field' (isDynamicCommand=true) while the command field in the incoming row is null or an empty string.","commonSituations":"The selected command field name changed upstream; a previous step emits null/empty values for some rows; wrong field index configured after editing the transformation.","solutions":["Verify the 'field name containing the command' setting points to the correct existing field in the stream","Fix the upstream step so the command field is populated for every row","Add a Filter/IF step to route rows with empty commands away from the SSH step","Switch back to a static command in the step dialog if a fixed command is intended"],"exampleFix":"// before\nrowCommandField = \"cmd\"; // field not present or empty in stream\n// after\n// ensure upstream generates the value:\n// Put a 'Data Grid' or 'JavaScript' step setting cmd = \"ls -l /tmp\"; then set the SSH step field to \"cmd\"","handlingStrategy":"validation","validationCode":"// before running the transformation, in an upstream step (UDJE/JS):\nif (field == null || field.trim().isEmpty()) {\n  throw new RuntimeException(\"SSH command field is empty for row \" + getRowNumber());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always validate the command field is non-empty before the SSH step","Add a Filter step routing empty-command rows to a dead-letter path","Lock the command field name in transformation metadata and review on refactor"],"tags":["ssh","empty-input","transform"],"backgroundTag":"empty-required-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}