{"record":{"id":"ccae58be7314e579","repo":"pentaho/pentaho-kettle","slug":"the-function-call-getoutputrowmeta-doesn-t-require-arguments-ccae58","errorCode":null,"errorMessage":"The function call getOutputRowMeta doesn't require arguments.","messagePattern":"The function call getOutputRowMeta doesn't require arguments\\.","errorType":"exception","errorClass":"RhinoRuntimeError","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesAddedFunctions.java","lineNumber":1962,"sourceCode":"  // Return the output row metadata\n  public static RowMetaInterface getOutputRowMeta( Context actualContext, Scriptable actualObject,\n    Object[] ArgList, Function FunctionContext ) {\n    if ( ArgList.length == 0 ) {\n      try {\n        Object scmO = actualObject.get( \"_step_\", actualObject );\n        try {\n          ScriptValuesMod scm = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );\n          return scm.getOutputRowMeta();\n        } catch ( Exception e ) {\n          ScriptValuesModDummy scm = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );\n          return scm.getOutputRowMeta();\n        }\n      } catch ( Exception e ) {\n        throw Context.reportRuntimeError( \"Unable to get the output row metadata because of an error: \"\n          + Const.CR + e.toString() );\n      }\n    } else {\n      throw Context.reportRuntimeError( \"The function call getOutputRowMeta doesn't require arguments.\" );\n    }\n  }\n\n  // Return the input row metadata\n  public static RowMetaInterface getInputRowMeta( Context actualContext, Scriptable actualObject,\n    Object[] ArgList, Function FunctionContext ) {\n    if ( ArgList.length == 0 ) {\n      try {\n        Object scmO = actualObject.get( \"_step_\", actualObject );\n        try {\n          ScriptValuesMod scm = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );\n          return scm.getInputRowMeta();\n        } catch ( Exception e ) {\n          ScriptValuesModDummy scm = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );\n          return scm.getInputRowMeta();\n        }\n      } catch ( Exception e ) {\n        throw Context.reportRuntimeError( \"Unable to get the input row metadata because of an error: \"","sourceCodeStart":1944,"sourceCodeEnd":1980,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesAddedFunctions.java#L1944-L1980","documentation":"Arity guard for getOutputRowMeta in the Rhino script-values step: the function takes no arguments, so any non-empty ArgList reaches the else-branch and throws before the \"_step_\" binding is consulted.","triggerScenarios":"Calling getOutputRowMeta(something) — any argument, including null or a mistakenly copied argument from another call.","commonSituations":"Confusing getOutputRowMeta with putRow (which takes a row); passing a row array out of habit; copy-paste from createRowCopy usage.","solutions":["Call getOutputRowMeta() with empty parentheses.","Remove any arguments from the call.","If you meant to pass output data, use putRow(Object[]) instead."],"exampleFix":"// before\ngetOutputRowMeta(row);\n// after\ngetOutputRowMeta();","handlingStrategy":"validation","validationCode":"// ensure no args: define a wrapper\nfunction outMeta() { return getOutputRowMeta(); }","typeGuard":null,"tryCatchPattern":"try { var m = getOutputRowMeta(); } catch (e) { logError(e.message); }","preventionTips":["Call with empty parentheses.","Don't confuse with putRow, which takes the row array.","Code-review scripts for accidental arguments on zero-arg accessors."],"tags":["javascript","argument-count","pentaho"],"backgroundTag":"invalid-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}