pentaho/pentaho-kettle · error · KettleException
No data location defined
Error message
No data location defined
What it means
During AvroInput.initializeSource, when the data location type is FIELD_NAME the input comes from a named incoming field; otherwise it must come from a configured data location (file/stream). If meta.getDataLocation() is null the step has no idea where to read Avro data from, so it aborts with a KettleException.
Solutions
- Open the Avro Input step dialog and set the data location (file name or stream source)
- If the location is a variable, verify the variable is defined at runtime
- If building StepMeta in code, call meta.setDataLocation(...) before execution
Example fix
// before
meta.setDataLocationType(AvroInputMetaBase.LocationDescriptor.FILENAME);
// no location set
// after
meta.setDataLocationType(AvroInputMetaBase.LocationDescriptor.FILENAME);
meta.setDataLocation("${Internal.Transformation.Filename.Directory}/data.avro"); Defensive patterns
Strategy: validation
Validate before calling
if (!AvroInputMetaBase.LocationDescriptor.FIELD_NAME.equals(meta.getDataLocationType())
&& (meta.getDataLocation() == null || meta.getDataLocation().isEmpty())) {
throw new KettleException("Avro Input step requires a data location (file/stream) unless reading from a field");
} Type guard
boolean hasDataLocation(AvroInputMetaBase meta) {
return meta.getDataLocationType() == AvroInputMetaBase.LocationDescriptor.FIELD_NAME
|| (meta.getDataLocation() != null && !meta.getDataLocation().isEmpty());
} Try / catch
try {
initializeSource(inputToStepRow);
} catch (KettleException e) {
logError("Avro input source is not configured: " + e.getMessage(), e);
setErrors(1);
stopAll();
} Prevention
- Always fill the data location (or choose field-name mode) in the step dialog
- Use ${variables} for paths and define them in kettle.properties per environment
- Validate step configuration before running the transformation in production
When it happens
Trigger: Running the Avro Input step with a location type other than FIELD_NAME while the 'data location' (filename/stream source) was never set in the step metadata.
Common situations: Transformation copied between environments where the file path variable is undefined; step created programmatically without setDataLocation; a repository/XML load that lost the location attribute.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- AvroInput.Error.MutipleDifferentExpansions
- AvroInput.Error.NoFieldPathsDefined
- AvroInput.Error.PathContainsMultipleExpansions
- AccessOutputMeta.Exception.FileDoesNotExist
- AccessOutputMeta.Exception.TableDoesNotExist
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/06b15ffbe648fff9.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java:178
in.setInputSchemaFile( schemaPath );
in.setInputFile( dataPath );
in.setBowl( bowl );
return in.getLeafFields();
}
/**
* @return false if no rows to process
* @throws Exception
*/
private boolean initializeSource() throws Exception {
inputToStepRow = getRow();
if ( inputToStepRow == null && ( meta.getDataLocationType()
== AvroInputMetaBase.LocationDescriptor.FIELD_NAME ) ) {
fileFinishedHousekeeping();
return false;
}
if ( meta.getDataLocation() == null ) {
throw new KettleException( "No data location defined" );
}
// setup the output row meta
RowMetaInterface outRowMeta = null;
outRowMeta = getInputRowMeta();
if ( outRowMeta != null ) {
outRowMeta = outRowMeta.clone();
} else {
outRowMeta = new RowMeta();
}
data.input = new PentahoAvroInputFormat();
meta.getFields( getTransMeta().getBowl(), outRowMeta, getStepname(), null, null, this, null, null );
data.input.setIncomingRowMeta( getInputRowMeta() );
data.input.setOutputRowMeta( outRowMeta );
data.input.setBowl( getTransMeta().getBowl() );
Boolean isDatum = false;
Boolean useFieldAsSchema = false;View on GitHub (pinned to f3058517a1)