{"record":{"id":"c47a2736505590ff","repo":"pentaho/pentaho-kettle","slug":"error-reading-dbf-file","errorCode":null,"errorMessage":"Error reading DBF file","messagePattern":"Error reading DBF file","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java","lineNumber":81,"sourceCode":"\n  public XBase( LogChannelInterface log, InputStream inputStream ) {\n    this.log = log;\n    this.dbfFile = null;\n    this.error = false;\n    this.reader = null;\n    this.inputstream = inputStream;\n  }\n\n  public void open() throws KettleException {\n    try {\n      if ( inputstream == null ) {\n        inputstream = new FileInputStream( dbfFile );\n      }\n      reader = new DBFReader( inputstream );\n    } catch ( DBFException e ) {\n      throw new KettleException( \"Error opening DBF metadata\", e );\n    } catch ( IOException e ) {\n      throw new KettleException( \"Error reading DBF file\", e );\n    }\n  }\n\n  @SuppressWarnings( \"fallthrough\" )\n  public RowMetaInterface getFields() throws KettleException {\n    String debug = \"get fields from XBase file\";\n    RowMetaInterface row = new RowMeta();\n\n    try {\n      // Fetch all field information\n      //\n      debug = \"allocate data types\";\n      datatype = new byte[reader.getFieldCount()];\n\n      for ( int i = 0; i < reader.getFieldCount(); i++ ) {\n        if ( log.isDebug() ) {\n          debug = \"get field #\" + i;\n        }","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java#L63-L99","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the file exists at dbfFile exactly (absolute path preferred) with ls / file browser before running.","Fix filesystem permissions so the executing user can read the file (chmod/chown or run as the file owner).","Remap network drives / ensure the share is mounted before the transformation runs.","Make the path a Kettle variable (e.g. ${DBF_FILE}) set at runtime instead of a hard-coded path."],"exampleFix":"// before\nString dbfFile = \"D:/data/customers.dbf\"; // drive absent on server\n// after\nString dbfFile = \"/mnt/shared/data/customers.dbf\"; // valid on execution host","handlingStrategy":"validation","validationCode":"File f = new File(dbfFile);\nif (!f.exists()) throw new java.io.FileNotFoundException(dbfFile);\nif (!f.canRead()) throw new java.io.AccessDeniedException(dbfFile);","typeGuard":null,"tryCatchPattern":"try {\n  xbase.open();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"Error reading DBF file\")) {\n    // resolve path/permission/share issue, then retry\n  }\n}","preventionTips":["Use absolute paths or Kettle variables; verify they resolve on the execution host.","Grant read permission to the service account running PDI.","Ensure network shares are mounted before job start (add a pre-flight check).","Confirm the file still exists at runtime — add an existence check step before XBase Input."],"tags":["dbf","xbase","io","file-not-found","kettle"],"backgroundTag":"file-not-found","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"}