{"record":{"id":"95eec930848af9d4","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-from-dbf-file-no-filename-specfied","errorCode":null,"errorMessage":"Unable to read from DBF file: no filename specfied","messagePattern":"Unable to read from DBF file: no filename specfied","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/shapefilereader/core/src/main/java/org/pentaho/di/shapefilereader/ShapeFileReaderMeta.java","lineNumber":238,"sourceCode":"\n        //Set encoding\n        if ( StringUtils.isNotBlank( encoding ) ) {\n          xbase.getReader().setCharactersetName( encoding );\n        }\n\n        RowMetaInterface fields = xbase.getFields();\n        for ( int i = 0; i < fields.size(); i++ ) {\n          fields.getValueMeta( i ).setOrigin( name );\n          row.addValueMeta( fields.getValueMeta( i ) );\n        }\n\n      } catch ( Throwable e ) {\n        throw new KettleStepException( \"Unable to read from DBF file\", e );\n      } finally {\n        xbase.close();\n      }\n    } else {\n      throw new KettleStepException( \"Unable to read from DBF file: no filename specfied\" );\n    }\n  }\n\n  public String getXML() {\n    String retval = \"\";\n\n    retval += \"    \" + XMLHandler.addTagValue( \"shapefilename\", shapeFilename );\n    retval += \"    \" + XMLHandler.addTagValue( \"dbffilename\", dbfFilename );\n    retval += \"    \" + XMLHandler.addTagValue( \"encoding\", encoding );\n\n    return retval;\n  }\n\n  public void readRep( Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters )\n    throws KettleException {\n    try {\n      shapeFilename = rep.getStepAttributeString( id_step, \"shapefilename\" );\n      dbfFilename = rep.getStepAttributeString( id_step, \"dbffilename\" );","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/shapefilereader/core/src/main/java/org/pentaho/di/shapefilereader/ShapeFileReaderMeta.java#L220-L256","documentation":"ShapeFileReaderMeta.getFields throws this KettleStepException when no DBF filename has been configured on the step, so there is no attribute file from which to derive the output fields. It is the guard branch taken when dbfFilename is empty/null.","triggerScenarios":"getFields is invoked while the step's 'dbffilename' setting is empty — e.g. the step was added to a transformation but never configured, or the filename was cleared in the dialog.","commonSituations":"Freshly dropped ShapeFileReader steps, transformations migrated from other tools where step settings were not preserved, or dialogs dismissed before saving the filename.","solutions":["Open the ShapeFileReader step dialog and set the DBF filename.","Save/re-serialize the transformation so the dbffilename attribute persists.","Add a validation in the step dialog's OK handler to refuse saving without a filename."],"exampleFix":"// before (unconfigured step)\nShapeFileReaderMeta meta = new ShapeFileReaderMeta(); // dbfFilename == null\nmeta.getFields( row, name, info, null, null, null );\n// after\nmeta.setDbfFilename( \"/data/roads.dbf\" );\nmeta.getFields( row, name, info, null, null, null );","handlingStrategy":"validation","validationCode":"if ( meta.getDbfFilename() == null || meta.getDbfFilename().trim().isEmpty() ) {\n  throw new KettleException( \"ShapeFileReader step has no DBF filename configured\" );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure the step fully before saving the transformation.","Enforce required fields in the step dialog's OK handler.","Review exported transformations for empty settings after migrations."],"tags":["dbf","missing-config","shapefile","kettle"],"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"}