pentaho/pentaho-kettle · error · KettleException

TextFileInput.Log.Error.ErrorConvertingLineText

TextFileInput.Log.Error.ErrorConvertingLineText

Error message

TextFileInput.Log.Error.ErrorConvertingLineText

What it means

convertLineToRow() wraps any unexpected exception in the overall line-to-row conversion (splitting, pass-through field copying, row construction) into a KettleException with the 'Error converting line to text' message. It is the outermost guard for the row-conversion path, so its cause can be nearly any downstream parsing error.

Solutions

  1. Inspect the attached cause exception for the concrete failure.
  2. Re-run 'Get Fields' or verify the Fields tab matches the file's current column layout.
  3. Enable step error handling to capture and inspect offending lines.
  4. Test the exact failing line in isolation via the step's preview to reproduce and debug.

Example fix

// before: Fields tab defines 5 columns but the file now has 7 (index issues during row build)
// after: refresh field definitions to match the current file layout
//   (Fields tab -> 'Get Fields from header...' -> verify types/formats)
Defensive patterns

Strategy: try-catch

Validate before calling

// Check token count vs configured fields before conversion
String[] tokens = line.split(Pattern.quote(delimiter), -1);
if (tokens.length != configuredFieldCount) {
  log.warn("Column mismatch: expected " + configuredFieldCount + " got " + tokens.length);
}

Try / catch

try {
  row = convertLineToRow(line);
} catch (KettleException e) {
  Throwable cause = e.getCause();
  logError("Row conversion failed (" + cause + ") for line: " + line);
  routeToErrorStream(line, cause);
}

Prevention

When it happens

Trigger: Any exception during row assembly: converter failures, array/index problems when mapping parsed tokens to fields, or passThruFields handling errors — whenever not already handled by the more specific per-field path.

Common situations: Field definitions out of sync with actual column count, metadata changed after files were produced, null converters, or corrupted/very long lines breaking token mapping.

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/8f53b6befbf23611. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/textfileinput/TextFileInput.java:838

          r[index] = uri;
          index++;
        }
        // Add RootUri
        if ( addRootUri ) {
          r[index] = rooturi;
          index++;
        }

        if ( passThruFields != null ) {
          // Simply add all fields from source files step
          for ( int i = 0; i < nrPassThruFields; i++ ) {
            r[i] = passThruFields[i];
          }
        }

      } // End if r != null
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "TextFileInput.Log.Error.ErrorConvertingLineText" ), e );
    }

    return r;

  }

  @Override
  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    data = (TextFileInputData) sdi;
    meta = (TextFileInputMeta) smi;
    Object[] r = null;
    boolean retval = true;
    boolean putrow = false;

    if ( first ) { // we just got started

      first = false;

View on GitHub (pinned to f3058517a1)