pentaho/pentaho-kettle · error · KettleException

Error reading DBF file

Error message

Error reading DBF file

What it means

XBase.open() also catches IOException while opening the file or constructing DBFReader and wraps it as 'Error reading DBF file'. This is the I/O-side counterpart of the DBFException case: the file exists structurally or not, but the OS/filesystem layer failed to read it.

Solutions

  1. Confirm the file exists at dbfFile exactly (absolute path preferred) with ls / file browser before running.
  2. Fix filesystem permissions so the executing user can read the file (chmod/chown or run as the file owner).
  3. Remap network drives / ensure the share is mounted before the transformation runs.
  4. Make the path a Kettle variable (e.g. ${DBF_FILE}) set at runtime instead of a hard-coded path.

Example fix

// before
String dbfFile = "D:/data/customers.dbf"; // drive absent on server
// after
String dbfFile = "/mnt/shared/data/customers.dbf"; // valid on execution host
Defensive patterns

Strategy: validation

Validate before calling

File f = new File(dbfFile);
if (!f.exists()) throw new java.io.FileNotFoundException(dbfFile);
if (!f.canRead()) throw new java.io.AccessDeniedException(dbfFile);

Try / catch

try {
  xbase.open();
} catch (KettleException e) {
  if (e.getMessage().contains("Error reading DBF file")) {
    // resolve path/permission/share issue, then retry
  }
}

Prevention

When it happens

Trigger: Calling open() (directly or via getOutputFields(), check(), getFields(), readFile()) when new FileInputStream(dbfFile) or new DBFReader(inputstream) throws IOException — missing file, no read permission, or stream read failure.

Common situations: Typo in the .dbf path or file moved after configuring the step; running the transformation as a service user lacking read permission on the file; file on a disconnected network share; relative path invalid under the job's working directory.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java:81

  public XBase( LogChannelInterface log, InputStream inputStream ) {
    this.log = log;
    this.dbfFile = null;
    this.error = false;
    this.reader = null;
    this.inputstream = inputStream;
  }

  public void open() throws KettleException {
    try {
      if ( inputstream == null ) {
        inputstream = new FileInputStream( dbfFile );
      }
      reader = new DBFReader( inputstream );
    } catch ( DBFException e ) {
      throw new KettleException( "Error opening DBF metadata", e );
    } catch ( IOException e ) {
      throw new KettleException( "Error reading DBF file", e );
    }
  }

  @SuppressWarnings( "fallthrough" )
  public RowMetaInterface getFields() throws KettleException {
    String debug = "get fields from XBase file";
    RowMetaInterface row = new RowMeta();

    try {
      // Fetch all field information
      //
      debug = "allocate data types";
      datatype = new byte[reader.getFieldCount()];

      for ( int i = 0; i < reader.getFieldCount(); i++ ) {
        if ( log.isDebug() ) {
          debug = "get field #" + i;
        }

View on GitHub (pinned to f3058517a1)