{"record":{"id":"b532d6c82a85b730","repo":"pentaho/pentaho-kettle","slug":"sftpput-error-sourcedataempty","errorCode":null,"errorMessage":"SFTPPut.Error.SourceDataEmpty","messagePattern":"SFTPPut\\.Error\\.SourceDataEmpty","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java","lineNumber":159,"sourceCode":"\n      // Move to folder\n      if ( meta.getAfterFTPS() == JobEntrySFTPPUT.AFTER_FTPSPUT_MOVE ) {\n        checkDestinationFolderField( meta.getDestinationFolderFieldName(), data );\n      }\n    }\n\n    // Read data top upload\n    String sourceData = getInputRowMeta().getString( r, data.indexOfSourceFileFieldName );\n\n    InputStream inputStream = null;\n    FileObject destinationFolder = null;\n    String destinationFilename;\n    FileObject file = null;\n\n    try {\n      if ( Utils.isEmpty( sourceData ) ) {\n        // Source data is empty\n        throw new KettleStepException( BaseMessages.getString( PKG, \"SFTPPut.Error.SourceDataEmpty\" ) );\n      }\n\n      if ( meta.isInputStream() ) {\n        // Source data is a stream\n        inputStream = new ByteArrayInputStream( getInputRowMeta().getBinary( r, data.indexOfSourceFileFieldName ) );\n\n        if ( data.indexOfRemoteFilename == -1 ) {\n          // for the case when put data is transferred via input field\n          // it is mandatory to specify remote file name\n          throw new KettleStepException( BaseMessages.getString( PKG, \"SFTPPut.Error.RemoteFilenameFieldMissing\" ) );\n        }\n        destinationFilename = getInputRowMeta().getString( r, data.indexOfRemoteFilename );\n      } else {\n        // source data is a file\n        // let's check file\n        file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( sourceData );\n\n        if ( !file.exists() ) {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java#L141-L177","documentation":"This KettleStepException is thrown by the SFTPPut step when the source data value for the row is null or empty. The step needs either an input stream (from a binary field) or a file path to upload via SFTP; without any source data there is nothing to put. It is a per-row configuration/data validation failure raised before any SFTP connection work is done.","triggerScenarios":"processRow encounters a row where the resolved sourceData (the value of the configured source filename field, or the stream content when meta.isInputStream() is true) is null or empty per Utils.isEmpty.","commonSituations":"The source filename field is missing/null in incoming rows; a previous step produced an empty filename; the wrong field was selected in the step dialog; the input stream option is enabled but the binary field is empty.","solutions":["Ensure the source filename field contains a non-empty path for every incoming row.","Fix the step configuration to point at the correct field that carries the source file path (or binary stream).","Add a Filter rows step upstream to drop or route rows with empty source data.","If the source file genuinely may be absent, handle it in an upstream step rather than letting rows reach SFTPPut."],"exampleFix":"// before: row reaches SFTPPut with empty source field\nrowProcessor.process(row); // sourceFilename = \"\"\n// after: guard upstream\nif (row.getSourceFilename() != null && !row.getSourceFilename().isEmpty()) {\n  rowProcessor.process(row);\n}","handlingStrategy":"validation","validationCode":"if (row == null || row.getSourceFilename() == null || row.getSourceFilename().isEmpty()) {\n  throw new IllegalArgumentException(\"source filename is empty; fix upstream step or filter row\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  transform.execute();\n} catch (KettleStepException e) {\n  if (e.getMessage().contains(\"SFTPPut.Error.SourceDataEmpty\")) {\n    log.warn(\"Row skipped: empty source data for SFTPPut\");\n  } else { throw e; }\n}","preventionTips":["Add a Filter rows step to drop rows with empty source filename before SFTPPut.","Use 'Check if field is null/empty' validations upstream.","Always pick source fields via 'Get Fields' rather than typing names.","Log row contents during development to catch empty fields early."],"tags":["kettle","pentaho","sftp","empty-input","data-validation"],"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"}