{"record":{"id":"d4f7a9b7751914d1","repo":"pentaho/pentaho-kettle","slug":"avroinput-error-nofieldpathsdefined","errorCode":"AvroInput.Error.NoFieldPathsDefined","errorMessage":"AvroInput.Error.NoFieldPathsDefined","messagePattern":"AvroInput\\.Error\\.NoFieldPathsDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroNestedReader.java","lineNumber":213,"sourceCode":"  protected AvroToPdiConverter m_avroToPdiConverter;\n\n  /**\n   * Factory for obtaining a decoder\n   */\n  protected DecoderFactory m_factory;\n\n  //protected static Class<?> PKG = AvroInputMeta.class;\n  protected static Class<?> PKG = AvroNestedReader.class;\n\n\n  protected void init() throws KettleException {\n    if ( m_schemaToUse != null ) {\n      m_avroToPdiConverter = new AvroToPdiConverter( m_schemaToUse );\n      initTopLevelStructure( m_schemaToUse, true );\n    }\n\n    if ( m_normalFields == null || m_normalFields.size() == 0 ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AvroInput.Error.NoFieldPathsDefined\" ) );\n    }\n\n    m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta );\n\n    int killmeIndex = 0;\n    for ( AvroInputField f : m_normalFields ) {\n      //bypass this for now: int outputIndex = m_outputRowMeta.indexOfValue( f.getPentahoFieldName() );\n      int outputIndex = killmeIndex++;\n      fieldInit( f, outputIndex );\n    }\n\n    if ( m_expansionHandler != null ) {\n      m_expansionHandler.init();\n    }\n    m_factory = new DecoderFactory();\n  }\n\n  /**","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroNestedReader.java#L195-L231","documentation":"AvroNestedReader.init requires at least one field path (the fields to read from the Avro records). If m_normalFields is null or empty, no output columns would be produced, so init throws a KettleException with the localized message 'AvroInput.Error.NoFieldPathsDefined'.","triggerScenarios":"Calling init() when no Avro input fields / field paths were configured on the step metadata.","commonSituations":"Running a transformation where the Avro Input step has an empty 'fields' mapping list; fields lost after XML/repository load failure; programmatic StepMeta setup without addField calls.","solutions":["Add field path mappings in the Avro Input step dialog (select fields from the schema)","Verify the step's field list survived save/load (re-open and re-save the step)","If building metadata in code, populate fields before init"],"exampleFix":"// before\nmeta.setFieldPaths(new String[0]); // no fields\n// after\nmeta.setFieldPaths(new String[]{ \"$.id\", \"$.name\" });","handlingStrategy":"validation","validationCode":"if (meta.getFields() == null || meta.getFields().isEmpty()) {\n  throw new KettleException(\"Avro Input step must define at least one field path before running\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  nestedReader.init();\n} catch (KettleException e) {\n  logError(\"No field paths configured: \" + e.getMessage());\n  setErrors(1);\n}","preventionTips":["Fill the fields grid in the Avro Input dialog before saving","Use the schema preview to select paths instead of typing them manually","Re-open saved transformations to confirm field mappings persisted"],"tags":["pdi","avro","configuration"],"backgroundTag":"empty-required-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"}