{"record":{"id":"ff5027c0e1d7f999","repo":"pentaho/pentaho-kettle","slug":"xbaseinputmeta-exception-unabletoreadmetadatafromxbasefile","errorCode":null,"errorMessage":"XBaseInputMeta.Exception.UnableToReadMetaDataFromXBaseFile","messagePattern":"XBaseInputMeta\\.Exception\\.UnableToReadMetaDataFromXBaseFile","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBaseInputMeta.java","lineNumber":318,"sourceCode":"\n  public RowMetaInterface getOutputFields( FileInputList files, String name ) throws KettleStepException {\n    RowMetaInterface rowMeta = new RowMeta();\n\n    // Take the first file to determine what the layout is...\n    //\n    XBase xbi = null;\n    try {\n      xbi = new XBase( getLog(), KettleVFS.getInputStream( files.getFile( 0 ) ) );\n      xbi.setDbfFile( files.getFile( 0 ).getName().getURI() );\n      xbi.open();\n      RowMetaInterface add = xbi.getFields();\n      for ( int i = 0; i < add.size(); i++ ) {\n        ValueMetaInterface v = add.getValueMeta( i );\n        v.setOrigin( name );\n      }\n      rowMeta.addRowMeta( add );\n    } catch ( Exception ke ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"XBaseInputMeta.Exception.UnableToReadMetaDataFromXBaseFile\" ), ke );\n    } finally {\n      if ( xbi != null ) {\n        xbi.close();\n      }\n    }\n\n    if ( rowNrAdded && rowNrField != null && rowNrField.length() > 0 ) {\n      ValueMetaInterface rnr = new ValueMetaInteger( rowNrField );\n      rnr.setOrigin( name );\n      rowMeta.addValueMeta( rnr );\n    }\n\n    if ( includeFilename ) {\n      ValueMetaInterface v = new ValueMetaString( filenameField );\n      v.setLength( 100, -1 );\n      v.setOrigin( name );\n      rowMeta.addValueMeta( v );","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBaseInputMeta.java#L300-L336","documentation":"Thrown by XBaseInputMeta.getOutputFields() when opening the XBase file(s) to derive the output RowMeta fails for any reason. The step needs the DBF structure (field names/types) to build output row metadata; if reading that metadata fails, a KettleStepException with this message is raised. The XBaseInput instance is closed in finally regardless.","triggerScenarios":"getFields() -> getOutputFields() opens the DBF file to read its schema; any exception there (file missing, unreadable, corrupt header, bad encoding) is wrapped with this message before being rethrown as KettleStepException.","commonSituations":"Typo in file path or filename from previous step, file deleted/moved after configuring the step, non-DBF file with .dbf extension, insufficient read permissions, wrong encoding setting.","solutions":["Verify the configured .dbf file path exists and is readable by the Pentaho user.","Open the DBF in a dBase viewer to confirm it has a valid header/field definitions.","Fix the encoding selection in the XBase Input dialog if the file uses a non-default code page.","Check the chained cause (KettleStepException.getCause()) for the underlying open/read failure.","When using 'accept filenames from previous step', confirm the upstream step actually produces the filename rows at design time."],"exampleFix":"// before: file configured but missing at runtime\nfilename = \"C:\\\\data\\\\customers.dbf\"; // file no longer exists\n\n// after: ensure path is valid before running the transformation\nFile f = new File( \"C:\\\\data\\\\customers.dbf\" );\nif ( !f.isFile() || !f.canRead() ) {\n  throw new KettleStepException( \"DBF file missing or unreadable: \" + f.getAbsolutePath() );\n}","handlingStrategy":"validation","validationCode":"File dbf = new File( configuredPath );\nif ( !dbf.isFile() || !dbf.canRead() || dbf.length() == 0 ) {\n  throw new KettleStepException( \"Cannot read DBF metadata; file invalid: \" + configuredPath );\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields( ... );\n} catch ( KettleStepException e ) {\n  logError( \"XBase metadata read failed: \" + e.getCause(), e );\n  // abort or fall back to a known-good schema definition\n}","preventionTips":["Verify file paths exist on the runtime host (paths may differ from dev machines).","Confirm the file is a real DBF (valid 32-byte header) with read permissions for the Pentaho user.","Set matching encoding in the step dialog before previewing.","Preview the step in Spoon to catch metadata problems at design time."],"tags":["pdi","xbase","dbf","metadata","file-read"],"backgroundTag":"file-read-failed","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"}