pentaho/pentaho-kettle · error · KettleException

Error during processing a row

Error message

Error during processing a row

What it means

Generic wrapper in LoadFileInput.getOneRow(): any Exception thrown while processing a single file/row (opening the file, decoding content, extracting fields, converting types per field definitions) is rethrown as KettleException("Error during processing a row", e). It is a catch-all around per-row processing, so the real cause is always in the wrapped exception.

Solutions

  1. Inspect the full stack trace's cause (the wrapped exception) — it names the actual file and failure.
  2. Fix the encoding setting in the Content tab to match the source file's charset.
  3. Correct field definitions (type, format, length) in the Fields tab to match file content, or enable tolerant parsing/error handling (step error handling with 'reject row').
  4. Verify file availability/permissions at runtime; if content can be arbitrary, route bad files out before this step.

Example fix

// before
// Encoding: UTF-8 on a Windows-1252 file -> decoding exception -> "Error during processing a row"
// after
// Content tab: Encoding = ISO-8859-1 (or pre-convert file to UTF-8 before the step)
Defensive patterns

Strategy: try-catch

Validate before calling

// Before running: verify encoding and field formats
Charset.availableCharsets().containsKey(Charset.forName(configuredEncoding).name());
// and confirm file exists: new File(path).exists()

Try / catch

try {
  while (processRow(...)) {}
} catch (KettleException e) {
  // Always log the wrapped cause — the real failure is e.getCause()
  Throwable cause = e.getCause();
  log.error("Row processing failed: " + (cause != null ? cause.toString() : e.toString()), e);
  // enable step error handling to route bad rows/files instead of failing the whole transformation
}

Prevention

When it happens

Trigger: During processRow -> outputRowData -> getOneRow, when reading a file's content fails: IOException opening/reading the FileObject, unsupported encoding, charset decoding errors, field type conversion failures (e.g. string to number/date), or XML/XPath extraction errors depending on configuration.

Common situations: File deleted between listing and reading; wrong 'Encoding' selected (e.g. UTF-8 vs ISO-8859-1 with invalid bytes); field format masks that do not match actual data; transient NFS/S3 mounts dropping; binary/corrupt files fed into the step.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/loadfileinput/LoadFileInput.java:451

      }
      // Add Uri
      if ( !Utils.isEmpty( meta.getUriField() ) ) {
        outputRowData[rowIndex++] = data.uriName;
      }
      // Add RootUri
      if ( !Utils.isEmpty( meta.getRootUriField() ) ) {
        outputRowData[rowIndex++] = data.rootUriName;
      }
      RowMetaInterface irow = getInputRowMeta();

      data.previousRow = irow == null ? outputRowData : irow.cloneRow( outputRowData ); // copy it to make
      // surely the next step doesn't change it in between...

      incrementLinesInput();
      data.rownr++;

    } catch ( Exception e ) {
      throw new KettleException( "Error during processing a row", e );
    }

    return outputRowData;
  }

  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (LoadFileInputMeta) smi;
    data = (LoadFileInputData) sdi;

    if ( super.init( smi, sdi ) ) {
      if ( !meta.getFileInFields() ) {
        try {
          data.files = meta.getFiles( getTransMeta().getBowl(), this );
          handleMissingFiles();
          // Create the output row meta-data
          data.outputRowMeta = new RowMeta();
          meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
            metaStore );

View on GitHub (pinned to f3058517a1)