pentaho/pentaho-kettle · error · KettleException
There was no variable name specified for value [
Error message
There was no variable name specified for value [
What it means
The Set Variable step iterates its configured fields and requires each field to have a target variable name. When the variable name field is empty but a value is present, the step aborts with this KettleException. It is a metadata validation error thrown during processRow via setValue.
Solutions
- Open the Set Variable step dialog and fill in the Variable name for every mapped field
- Check field i corresponds to the row line shown and fix off-by-one field mapping
- Verify the transformation metadata XML/repository rows contain non-empty variable_name attributes
- Add a precondition check or Select Values step to ensure the variable-name source column is populated
Example fix
// before (step meta)
field[] = { name="amount", variable="" }
// after
field[] = { name="amount", variable="AMOUNT" } Defensive patterns
Strategy: validation
Validate before calling
// before executing the transformation, validate step meta
for (SetVariableMeta sv : setVariableSteps) {
for (int i = 0; i < sv.getFieldName().length; i++) {
if (sv.getFieldName()[i] != null && (sv.getVariableName()[i] == null || sv.getVariableName()[i].isEmpty()))
throw new IllegalArgumentException("Field " + sv.getFieldName()[i] + " has no variable name");
}
} Type guard
boolean hasVariableName(String name) { return name != null && !name.trim().isEmpty(); } Try / catch
try { trans.execute(null); } catch (KettleException e) { if (e.getMessage().contains("no variable name specified")) { /* fix step meta or skip */ } else throw e; } Prevention
- Always fill the Variable name column when adding fields in the Set Variable dialog
- Run transformation meta validation (getFields/check) before execution
- Keep variable names in shared metadata to avoid blank entries
When it happens
Trigger: A row is processed where field index i has a non-empty value but meta.getVariableName()[i] is null or empty (Utils.isEmpty).
Common situations: A developer added a field to the Set Variable step in Spoon but left the 'Variable name' column blank; a saved transformation had the variable name cleared or not migrated by an older version.
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
- Can't set variable [
- API coding error: please specify the conversion metadata…
- Calculator.Error.NoNameField
- Calculator.Error.UnableFindField
- Calculator.ErrorInStepRunning
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/5bda0626e32c651f.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/setvariable/SetVariable.java:127
value = valueMeta.getString( valueData );
} else {
value = valueMeta.getCompatibleString( valueData );
}
}
if ( value == null ) {
value = "";
}
// Get variable name
String varname = meta.getVariableName()[i];
if ( Utils.isEmpty( varname ) ) {
if ( Utils.isEmpty( value ) ) {
throw new KettleException( "Variable name nor value was specified on line #" + ( i + 1 ) );
} else {
throw new KettleException( "There was no variable name specified for value [" + value + "]" );
}
}
Job parentJob = null;
// We always set the variable in this step and in the parent transformation...
//
setVariable( varname, value );
// Set variable in the transformation
//
Trans trans = getTrans();
trans.setVariable( varname, value );
// Make a link between the transformation and the parent transformation (in a sub-transformation)
//
while ( trans.getParentTrans() != null ) {
trans = trans.getParentTrans();View on GitHub (pinned to f3058517a1)