pentaho/pentaho-kettle · error · RhinoRuntimeError

Unable to pass the new row to the next step(s) because of…

Error message

Unable to pass the new row to the next step(s) because of an error: 

What it means

putRow(newRow) forwards a constructed row to the next steps via the bound step object; if the row push fails at any point (step lookup, metadata access, putRow call), the implementation throws this Rhino runtime error with the underlying exception appended. It signals the script could not emit the row downstream.

Solutions

  1. Ensure the new row matches getOutputRowMeta() field count and types.
  2. Call putRow only during row processing, not in the script's init phase.
  3. Confirm the step has a connected output hop and the transformation is running normally.
  4. Read the appended exception (after Const.CR) for the root cause.

Example fix

// before
putRow([f1]); // output meta expects 3 fields
// after
var row = createRowCopy(3);
row[2] = 'new value';
putRow(row);
Defensive patterns

Strategy: try-catch

Validate before calling

// match row shape to output metadata before putRow
var meta = getOutputRowMeta();
if (newRow.length !== meta.size()) throw new Error('row field count mismatch');

Try / catch

try { putRow(newRow); } catch (e) { logError('putRow failed: ' + e.message); }

Prevention

When it happens

Trigger: Calling putRow(Object[]) when '_step_' cannot be resolved, output row metadata is unavailable, or the downstream putRow call throws (e.g. transformation stopping, row shape inconsistent with metadata).

Common situations: Building rows whose field count/types don't match the output metadata; calling putRow during initialization before metadata exists; using putRow in steps without downstream hops configured.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesAddedFunctions.java:2026

  // put a row out to the next steps...
  //
  public static void putRow( Context actualContext, Scriptable actualObject, Object[] ArgList,
    Function FunctionContext ) {
    if ( ArgList.length == 1 ) {
      try {
        Object[] newRow = (Object[]) Context.jsToJava( ArgList[0], ( new Object[] {} ).getClass() );

        Object scmO = actualObject.get( "_step_", actualObject );
        try {
          ScriptValuesMod step = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );
          step.putRow( step.getOutputRowMeta(), newRow );
        } catch ( Exception e ) {
          ScriptValuesModDummy step = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );
          step.putRow( step.getOutputRowMeta(), newRow );
        }

      } catch ( Exception e ) {
        throw Context.reportRuntimeError( "Unable to pass the new row to the next step(s) because of an error: "
          + Const.CR + e.toString() );
      }
    } else {
      throw Context
        .reportRuntimeError( "The function call putRow requires 1 argument : the output row data (Object[])" );
    }
  }

  public static void deleteFile( Context actualContext, Scriptable actualObject, Object[] ArgList,
    Function FunctionContext ) {

    try {
      if ( ArgList.length == 1 && !isNull( ArgList[0] ) && !isUndefined( ArgList[0] ) ) {
        // Object act = actualObject.get("_step_", actualObject);
        // ScriptValuesMod act = (ScriptValuesMod)Context.toType(scm_delete, ScriptValuesMod.class);

        FileObject fileObject = null;

View on GitHub (pinned to f3058517a1)