pentaho/pentaho-kettle · error · KettleStepException

SFTPPut.Error.SourceDataEmpty

Error message

SFTPPut.Error.SourceDataEmpty

What it means

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.

Solutions

  1. Ensure the source filename field contains a non-empty path for every incoming row.
  2. Fix the step configuration to point at the correct field that carries the source file path (or binary stream).
  3. Add a Filter rows step upstream to drop or route rows with empty source data.
  4. If the source file genuinely may be absent, handle it in an upstream step rather than letting rows reach SFTPPut.

Example fix

// before: row reaches SFTPPut with empty source field
rowProcessor.process(row); // sourceFilename = ""
// after: guard upstream
if (row.getSourceFilename() != null && !row.getSourceFilename().isEmpty()) {
  rowProcessor.process(row);
}
Defensive patterns

Strategy: validation

Validate before calling

if (row == null || row.getSourceFilename() == null || row.getSourceFilename().isEmpty()) {
  throw new IllegalArgumentException("source filename is empty; fix upstream step or filter row");
}

Try / catch

try {
  transform.execute();
} catch (KettleStepException e) {
  if (e.getMessage().contains("SFTPPut.Error.SourceDataEmpty")) {
    log.warn("Row skipped: empty source data for SFTPPut");
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/b532d6c82a85b730. Report an issue: GitHub.

Appendix: source

Thrown at plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java:159

      // Move to folder
      if ( meta.getAfterFTPS() == JobEntrySFTPPUT.AFTER_FTPSPUT_MOVE ) {
        checkDestinationFolderField( meta.getDestinationFolderFieldName(), data );
      }
    }

    // Read data top upload
    String sourceData = getInputRowMeta().getString( r, data.indexOfSourceFileFieldName );

    InputStream inputStream = null;
    FileObject destinationFolder = null;
    String destinationFilename;
    FileObject file = null;

    try {
      if ( Utils.isEmpty( sourceData ) ) {
        // Source data is empty
        throw new KettleStepException( BaseMessages.getString( PKG, "SFTPPut.Error.SourceDataEmpty" ) );
      }

      if ( meta.isInputStream() ) {
        // Source data is a stream
        inputStream = new ByteArrayInputStream( getInputRowMeta().getBinary( r, data.indexOfSourceFileFieldName ) );

        if ( data.indexOfRemoteFilename == -1 ) {
          // for the case when put data is transferred via input field
          // it is mandatory to specify remote file name
          throw new KettleStepException( BaseMessages.getString( PKG, "SFTPPut.Error.RemoteFilenameFieldMissing" ) );
        }
        destinationFilename = getInputRowMeta().getString( r, data.indexOfRemoteFilename );
      } else {
        // source data is a file
        // let's check file
        file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( sourceData );

        if ( !file.exists() ) {

View on GitHub (pinned to f3058517a1)