pentaho/pentaho-kettle · error · RhinoRuntimeError

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

Error message

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

What it means

getInputRowMeta() fetches the incoming row metadata via the '_step_' object; any exception during step lookup or getInputRowMeta() invocation results in this Rhino runtime error with the underlying exception appended. It means the script could not access the input row structure.

Solutions

  1. Ensure the step has an incoming hop so input row metadata is defined.
  2. Run the transformation normally so the '_step_' object is properly bound.
  3. Read the appended exception text to identify the root cause.
  4. Wrap the call in a JS try/catch with a fallback.

Example fix

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

Strategy: try-catch

Try / catch

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

Prevention

When it happens

Trigger: Calling getInputRowMeta() when the '_step_' binding cannot be converted to a step/dummy instance, or the step's getInputRowMeta() throws (e.g. metadata not yet available).

Common situations: Running the step with no input rows so input metadata is null; executing scripts in unit tests without a transformation context; using the function in a step type that doesn't expose input metadata.

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/41f029180916e72c. Report an issue: GitHub.

Appendix: source

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

      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 );
          return scm.getInputRowMeta();
        }
      } catch ( Exception e ) {
        throw Context.reportRuntimeError( "Unable to get the input row metadata because of an error: "
          + Const.CR + e.toString() );
      }
    } else {
      throw Context.reportRuntimeError( "The function call getInputRowMeta doesn't require arguments." );
    }
  }

  // Return the input row metadata
  public static Object[] createRowCopy( Context actualContext, Scriptable actualObject, Object[] ArgList,
    Function FunctionContext ) {
    if ( ArgList.length == 1 ) {
      try {
        int newSize = (int) Math.round( Context.toNumber( ArgList[0] ) );

        Object scmO = actualObject.get( "row", actualObject );
        Object[] row = (Object[]) Context.jsToJava( scmO, ( new Object[] {} ).getClass() );

        return RowDataUtil.createResizedCopy( row, newSize );

View on GitHub (pinned to f3058517a1)