pentaho/pentaho-kettle · error · KettleEOFException

Row.EndOfFileReached

Error message

Row.EndOfFileReached

What it means

getEnvironmentVar returns the value of a JVM system property from within JavaScript, and it requires exactly 1 argument (the property name). When ArgList.length != 1 the function throws this Rhino runtime error at ScriptValuesAddedFunctions.java:1629 instead of returning a value. Note the function returns an empty string (not an error) if the property lookup itself fails.

Solutions

  1. Call with exactly one string argument: getEnvironmentVar('MY_KEY').
  2. Handle the empty-string return for missing properties yourself: var v = getEnvironmentVar('K'); if (v == '') v = 'default'.
  3. Remove any extra/default arguments from the call.

Example fix

// before
var v = getEnvironmentVar("MY_KEY", "default");
// after
var v = getEnvironmentVar("MY_KEY");
if (v == "") v = "default";
Defensive patterns

Strategy: validation

Validate before calling

if (arguments.length !== 1) throw new Error("getEnvironmentVar takes exactly one property name");

Type guard

null

Try / catch

var v;
try {
  v = getEnvironmentVar("MY_KEY");
} catch (e) {
  v = ""; // treat as missing
}
if (v == "") v = "default";

Prevention

When it happens

Trigger: Calling getEnvironmentVar() with zero arguments, or with 2+ arguments such as getEnvironmentVar('A', 'B'), from JavaScript in the Script Values step.

Common situations: Passing a fallback default as a second argument (assuming an API that does not exist); accidentally passing an extra separator or option argument; calling with no arguments after refactoring.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/compatibility/Row.java:487

    // get all values in the row
    for ( int i = 0; i < size; i++ ) {
      Value v = new Value();
      v.readObj( dis );
      addValue( v );
    }
  }

  /**
   * Read a row of Values from an input-stream.
   *
   * @param dis
   *          The DataInputStream to read from
   */
  public Row( DataInputStream dis ) throws KettleFileException {
    try {
      readObj( dis );
    } catch ( EOFException e ) {
      throw new KettleEOFException( BaseMessages.getString( PKG, "Row.EndOfFileReached" ), e );
    } catch ( Exception e ) {
      throw new KettleFileException( BaseMessages.getString( PKG, "Row.ErrorReadingRowData" ), e );
    }
  }

  /**
   * Read a number of Values without meta-data into a row.
   *
   * @param dis
   *          The DataInputStream to read from
   * @param meta
   *          The description (name, type, length, precision) of the values to be read (the same number of values are
   *          read)
   * @throws KettleFileException
   *           if the row couldn't be created by reading from the data input stream.
   */
  public Row( DataInputStream dis, Row meta ) throws KettleFileException {
    this( dis, meta.size(), meta );

View on GitHub (pinned to f3058517a1)