{"record":{"id":"06b15ffbe648fff9","repo":"pentaho/pentaho-kettle","slug":"no-data-location-defined","errorCode":null,"errorMessage":"No data location defined","messagePattern":"No data location defined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java","lineNumber":178,"sourceCode":"    in.setInputSchemaFile( schemaPath );\n    in.setInputFile( dataPath );\n    in.setBowl( bowl );\n    return in.getLeafFields();\n  }\n\n  /**\n   * @return false if no rows to process\n   * @throws Exception\n   */\n  private boolean initializeSource() throws Exception {\n    inputToStepRow = getRow();\n    if ( inputToStepRow == null && ( meta.getDataLocationType()\n      == AvroInputMetaBase.LocationDescriptor.FIELD_NAME ) ) {\n      fileFinishedHousekeeping();\n      return false;\n    }\n    if ( meta.getDataLocation() == null ) {\n      throw new KettleException( \"No data location defined\" );\n    }\n\n    // setup the output row meta\n    RowMetaInterface outRowMeta = null;\n    outRowMeta = getInputRowMeta();\n    if ( outRowMeta != null ) {\n      outRowMeta = outRowMeta.clone();\n    } else {\n      outRowMeta = new RowMeta();\n    }\n\n    data.input = new PentahoAvroInputFormat();\n    meta.getFields( getTransMeta().getBowl(), outRowMeta, getStepname(), null, null, this, null, null );\n    data.input.setIncomingRowMeta( getInputRowMeta() );\n    data.input.setOutputRowMeta( outRowMeta );\n    data.input.setBowl( getTransMeta().getBowl() );\n    Boolean isDatum = false;\n    Boolean useFieldAsSchema = false;","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInput.java#L160-L196","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nmeta.setDataLocationType(AvroInputMetaBase.LocationDescriptor.FILENAME);\n// no location set\n// after\nmeta.setDataLocationType(AvroInputMetaBase.LocationDescriptor.FILENAME);\nmeta.setDataLocation(\"${Internal.Transformation.Filename.Directory}/data.avro\");","handlingStrategy":"validation","validationCode":"if (!AvroInputMetaBase.LocationDescriptor.FIELD_NAME.equals(meta.getDataLocationType())\n    && (meta.getDataLocation() == null || meta.getDataLocation().isEmpty())) {\n  throw new KettleException(\"Avro Input step requires a data location (file/stream) unless reading from a field\");\n}","typeGuard":"boolean hasDataLocation(AvroInputMetaBase meta) {\n  return meta.getDataLocationType() == AvroInputMetaBase.LocationDescriptor.FIELD_NAME\n      || (meta.getDataLocation() != null && !meta.getDataLocation().isEmpty());\n}","tryCatchPattern":"try {\n  initializeSource(inputToStepRow);\n} catch (KettleException e) {\n  logError(\"Avro input source is not configured: \" + e.getMessage(), e);\n  setErrors(1);\n  stopAll();\n}","preventionTips":["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"],"tags":["pdi","configuration","avro"],"backgroundTag":"missing-required-config-field","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"}