pentaho/pentaho-kettle · error · KettleStepException

Unable to read from DBF file: no filename specfied

Error message

Unable to read from DBF file: no filename specfied

What it means

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.

Solutions

  1. Open the ShapeFileReader step dialog and set the DBF filename.
  2. Save/re-serialize the transformation so the dbffilename attribute persists.
  3. Add a validation in the step dialog's OK handler to refuse saving without a filename.

Example fix

// before (unconfigured step)
ShapeFileReaderMeta meta = new ShapeFileReaderMeta(); // dbfFilename == null
meta.getFields( row, name, info, null, null, null );
// after
meta.setDbfFilename( "/data/roads.dbf" );
meta.getFields( row, name, info, null, null, null );
Defensive patterns

Strategy: validation

Validate before calling

if ( meta.getDbfFilename() == null || meta.getDbfFilename().trim().isEmpty() ) {
  throw new KettleException( "ShapeFileReader step has no DBF filename configured" );
}

Prevention

When it happens

Trigger: 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.

Common situations: Freshly dropped ShapeFileReader steps, transformations migrated from other tools where step settings were not preserved, or dialogs dismissed before saving the filename.

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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/95eec930848af9d4. Report an issue: GitHub.

Appendix: source

Thrown at plugins/shapefilereader/core/src/main/java/org/pentaho/di/shapefilereader/ShapeFileReaderMeta.java:238

        //Set encoding
        if ( StringUtils.isNotBlank( encoding ) ) {
          xbase.getReader().setCharactersetName( encoding );
        }

        RowMetaInterface fields = xbase.getFields();
        for ( int i = 0; i < fields.size(); i++ ) {
          fields.getValueMeta( i ).setOrigin( name );
          row.addValueMeta( fields.getValueMeta( i ) );
        }

      } catch ( Throwable e ) {
        throw new KettleStepException( "Unable to read from DBF file", e );
      } finally {
        xbase.close();
      }
    } else {
      throw new KettleStepException( "Unable to read from DBF file: no filename specfied" );
    }
  }

  public String getXML() {
    String retval = "";

    retval += "    " + XMLHandler.addTagValue( "shapefilename", shapeFilename );
    retval += "    " + XMLHandler.addTagValue( "dbffilename", dbfFilename );
    retval += "    " + XMLHandler.addTagValue( "encoding", encoding );

    return retval;
  }

  public void readRep( Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters )
    throws KettleException {
    try {
      shapeFilename = rep.getStepAttributeString( id_step, "shapefilename" );
      dbfFilename = rep.getStepAttributeString( id_step, "dbffilename" );

View on GitHub (pinned to f3058517a1)