pentaho/pentaho-kettle · error · RuntimeException
The function call putRow requires 1 argument : the output…
Error message
The function call putRow requires 1 argument : the output row data (Object[])
What it means
The JavaScript transform's putRow() helper in ScriptAddedFunctions validates the argument list before passing a row downstream. It requires exactly one argument: the output row as an Object[] (Kettle row array). If ArgList is null, empty, or contains more than one element, the function refuses to run and throws this RuntimeException.
Solutions
- Pass exactly one argument: putRow(new Object[] { value1, value2 }) or putRow(row).
- If you intended to send the input row through, store it first (var row = getInputRow(); ...) and pass that single variable.
- Remove any extra boolean/context arguments from the putRow call; this API accepts only the row array.
- Check the script for multiple putRow overloads/typos (e.g. putRow vs putRowInstr) and use the documented one-argument form.
Example fix
// before putRow(row, true); // after putRow(row);
Defensive patterns
Strategy: validation
Validate before calling
// JavaScript in the Script step
var row = getInputRow();
if (row == null) { throw new Error('putRow requires a row array'); }
putRow(row); // exactly one argument Type guard
function isRowArray(r) { return r != null && Array.isArray(r); } Prevention
- Always call putRow with a single row-array argument
- Store the input row in a variable before modifying it
- Grep scripts for putRow( calls with multiple arguments during review
When it happens
Trigger: Calling putRow() with no arguments, calling putRow(row, extraArg), or calling putRow(null) from a JavaScript/Script step so that ArgList.length != 1.
Common situations: Copy-pasted JavaScript snippets where putRow is called with leftover arguments; scripts written for a different API (e.g. putRow(row, true) variants); refactored scripts where the row variable was removed or renamed and a stale call remains.
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
- Could not convert the given String :
- e.toString()
- Please provide a valid Char to the fillString
- Script.Log.CouldNotAddDefaultConstants
- Script.Log.CouldNotAttachAdditionalScripts
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/101cb4e3fabc4c9d.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java:1943
if ( ArgList.length == 1 ) {
try {
Object[] newRow = (Object[]) ArgList[0];
Object scmO = actualObject.get( "_step_" );
try {
Script step = (Script) scmO;
step.putRow( step.getOutputRowMeta(), newRow );
} catch ( Exception e ) {
ScriptDummy step = (ScriptDummy) scmO;
step.putRow( step.getOutputRowMeta(), newRow );
}
} catch ( Exception e ) {
throw new RuntimeException( "Unable to pass the new row to the next step(s) because of an error: "
+ Const.CR + e.toString() );
}
} else {
throw new RuntimeException( "The function call putRow requires 1 argument : the output row data (Object[])" );
}
}
public static void deleteFile( Bowl bowl, ScriptEngine actualContext, Bindings actualObject, Object[] ArgList,
Object 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;
try {
fileObject = KettleVFS.getInstance( bowl ).getFileObject( (String) ArgList[0] );
if ( fileObject.exists() ) {
if ( fileObject.getType() == FileType.FILE ) {
if ( !fileObject.delete() ) {View on GitHub (pinned to f3058517a1)