{"record":{"id":"5fb54c9edd661dde","repo":"pentaho/pentaho-kettle","slug":"error-reading-dbf-metadata-in-part","errorCode":null,"errorMessage":"Error reading DBF metadata (in part ","messagePattern":"Error reading DBF metadata \\(in part ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java","lineNumber":145,"sourceCode":"            value.setLength( -1, -1 );\n            break;\n          case DBFField.FIELD_TYPE_D: // Date\n            debug = \"Date field\";\n            value = new ValueMetaDate( field.getName() );\n            value.setLength( -1, -1 );\n            break;\n          default:\n            if ( ( log != null ) && ( log.isDebug() ) ) {\n              log.logDebug( \"Unknown Datatype\" + datatype[i] );\n            }\n        }\n\n        if ( value != null ) {\n          row.addValueMeta( value );\n        }\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error reading DBF metadata (in part \" + debug + \")\", e );\n    }\n\n    return row;\n  }\n\n  public Object[] getRow( RowMetaInterface fields ) throws KettleException {\n    return getRow( RowDataUtil.allocateRowData( fields.size() ) );\n  }\n\n  public Object[] getRow( Object[] r ) throws KettleException {\n    try {\n      // Read the next record\n      //\n      Object[] rowobj = reader.nextRecord();\n\n      // Are we at the end yet?\n      //\n      if ( rowobj == null ) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java#L127-L163","documentation":"XBase.getFields() reads the DBF column definitions and builds a RowMetaInterface; any Exception during that processing is wrapped as 'Error reading DBF metadata (in part <debug>)', where debug names the phase (e.g. 'get fields from XBase file'). It means the file opened but its field metadata could not be converted into Kettle value metadata.","triggerScenarios":"Calling getFields() (or testGetFields()) after a successful open() when iterating reader.getFieldCount()/getField(...) or building ValueMeta objects throws — e.g. malformed field descriptors, unsupported field types, or a reader in a bad state.","commonSituations":"DBF with exotic/undocumented field types from a proprietary tool; memo (.dbt/.fpt) fields the JavaDBF lib mishandles; calling getFields() before open() so the reader is null; charset/encoding problems in field names.","solutions":["Read the 'in part <debug>' message and the cause to identify the failing phase.","Ensure open() succeeded before getFields() — verify the file path is a valid DBF (see earlier open errors).","Re-export the DBF with standard dBASE III field types (C/N/F/L/D) only; drop unsupported types like memo/BLOB.","Upgrade JavaDBF/PDI version if the file uses newer DBF dialect features."],"exampleFix":"// before: field of unsupported type BLOB in DBF\n// after: re-export DBF with only supported types (CHAR, NUMERIC, FLOAT, LOGICAL, DATE)","handlingStrategy":"try-catch","validationCode":"try {\n  xbase.open();\n  RowMetaInterface fields = xbase.getFields(); // probe metadata early\n} catch (KettleException e) {\n  // fail fast with a clear message before the main run\n  throw new IllegalStateException(\"DBF metadata unreadable: \" + e.getMessage(), e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  RowMetaInterface fields = xbase.getFields();\n} catch (KettleException e) {\n  log.error(\"DBF metadata unreadable: \" + e.getCause(), e);\n  // re-export DBF with standard field types\n}","preventionTips":["Probe getFields() in a small pre-step before the full transformation.","Restrict source DBF exports to standard dBASE field types.","Avoid memo/blob columns in files consumed by XBase Input.","Keep JavaDBF/PDI versions current for newer DBF dialects."],"tags":["dbf","xbase","metadata","kettle"],"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"}