pentaho/pentaho-kettle · error · RhinoRuntimeError

Unable to get the output row metadata because of an error:

Error message

Unable to get the output row metadata because of an error: 

What it means

getOutputRowMeta() retrieves the row metadata (RowMetaInterface) from the step by reading the '_step_' object; if any exception occurs while resolving the step or fetching metadata, it throws this Rhino runtime error with the exception appended after Const.CR. It signals the script could not access the step's output row structure.

Solutions

  1. Ensure the script runs inside an actual ScriptValuesMod step execution, not a standalone engine.
  2. Check the transformation initializes correctly and the step is connected so output metadata exists.
  3. Inspect the appended exception (after the message) for the root cause, e.g. ClassCastException.
  4. Guard in script: call getOutputRowMeta only after the first row flow or inside try/catch returning a fallback.

Example fix

// before
var meta = getOutputRowMeta();
// after
try { var meta = getOutputRowMeta(); } catch (e) { var meta = null; }
Defensive patterns

Strategy: try-catch

Try / catch

try { var meta = getOutputRowMeta(); } catch (e) { logError('getOutputRowMeta failed: ' + e.message); var meta = null; }

Prevention

When it happens

Trigger: Calling getOutputRowMeta() when the '_step_' scriptable property is missing or fails jsToJava conversion to ScriptValuesModDummy/StepInterface, or when getOutputRowMeta() on the step itself throws.

Common situations: Using getOutputRowMeta() during preview before row metadata exists; running the script in a context (e.g. test harness) without a real step instance; step not yet initialized.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

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

    }
    return sRC;
  }

  // Return the output row metadata
  public static RowMetaInterface getOutputRowMeta( Context actualContext, Scriptable actualObject,
    Object[] ArgList, Function FunctionContext ) {
    if ( ArgList.length == 0 ) {
      try {
        Object scmO = actualObject.get( "_step_", actualObject );
        try {
          ScriptValuesMod scm = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );
          return scm.getOutputRowMeta();
        } catch ( Exception e ) {
          ScriptValuesModDummy scm = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );
          return scm.getOutputRowMeta();
        }
      } catch ( Exception e ) {
        throw Context.reportRuntimeError( "Unable to get the output row metadata because of an error: "
          + Const.CR + e.toString() );
      }
    } else {
      throw Context.reportRuntimeError( "The function call getOutputRowMeta doesn't require arguments." );
    }
  }

  // Return the input row metadata
  public static RowMetaInterface getInputRowMeta( Context actualContext, Scriptable actualObject,
    Object[] ArgList, Function FunctionContext ) {
    if ( ArgList.length == 0 ) {
      try {
        Object scmO = actualObject.get( "_step_", actualObject );
        try {
          ScriptValuesMod scm = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );
          return scm.getInputRowMeta();
        } catch ( Exception e ) {
          ScriptValuesModDummy scm = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );

View on GitHub (pinned to f3058517a1)