{"record":{"id":"6a5984b3e701dd6e","repo":"pentaho/pentaho-kettle","slug":"accessoutputmeta-exception-errorgettingfields","errorCode":"AccessOutputMeta.Exception.ErrorGettingFields","errorMessage":"AccessOutputMeta.Exception.ErrorGettingFields","messagePattern":"AccessOutputMeta\\.Exception\\.ErrorGettingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessoutput/AccessOutputMeta.java","lineNumber":266,"sourceCode":"    try {\n      if ( !file.exists() || !file.isFile() ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"AccessOutputMeta.Exception.FileDoesNotExist\", realFilename ) );\n      }\n\n      // Open the database in read-only mode and get the table metadata.\n      try ( Database db = new DatabaseBuilder( file ).setReadOnly( true ).open() ) {\n        String realTablename = space.environmentSubstitute( tablename );\n        Table table = db.getTable( realTablename );\n        if ( table == null ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"AccessOutputMeta.Exception.TableDoesNotExist\", realTablename ) );\n        }\n\n        return getLayout( table );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AccessOutputMeta.Exception.ErrorGettingFields\" ), e );\n    }\n  }\n\n  public static final RowMetaInterface getLayout( Table table ) throws KettleStepException {\n    RowMetaInterface row = new RowMeta();\n    List<? extends Column> columns = table.getColumns();\n    for ( int i = 0; i < columns.size(); i++ ) {\n      ColumnLayout layout = resolveColumnLayout( columns.get( i ) );\n      row.addValueMeta( createValueMeta( columns.get( i ).getName(), layout ) );\n    }\n\n    return row;\n  }\n\n  private static ColumnLayout resolveColumnLayout( Column column ) throws KettleStepException {\n    int type = getSqlType( column );\n    switch ( type ) {\n      case java.sql.Types.CHAR:","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessoutput/AccessOutputMeta.java#L248-L284","documentation":"AccessOutputMeta.getRequiredFields wraps any exception encountered while reading the table's layout (columns, types, lengths) into KettleException(AccessOutputMeta.Exception.ErrorGettingFields). It is a catch-all around database open/read so callers get a single, labeled failure for field extraction problems.","triggerScenarios":"getRequiredFields fails for reasons other than the file/table checks: the Access file is corrupt or locked, Jackcess throws IOException while opening/reading the table, or the file is an unsupported Access version.","commonSituations":"Corrupted .mdb after an abrupt shutdown; file locked by another process; password-protected Access DB; newer .accdb features unsupported by the Jackcess version in use.","solutions":["Inspect the wrapped cause for the root IOException","Test the file opens in Microsoft Access or Jackcess directly","Close other processes holding a lock on the file (delete .ldb lock file)","Repair/compact the Access database","Upgrade the Jackcess/PDI version to support the Access file format"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"File f = new File(space.environmentSubstitute(meta.getFilename()));\nif (!f.canRead()) throw new IllegalStateException(\"Access DB not readable: \" + f);\n// check no lock file (.ldb) indicates exclusive open by another process","typeGuard":null,"tryCatchPattern":"try {\n  RowMetaInterface fields = meta.getRequiredFields(space);\n} catch (KettleException e) {\n  log.error(\"Error reading Access fields\", e.getCause());\n  // repair DB, close locking process, or upgrade Jackcess\n}","preventionTips":["Ensure the Access file is not open exclusively elsewhere","Compact/repair Access databases periodically","Use supported Access file formats for the bundled Jackcess version","Check file readability on the execution host"],"tags":["access","jackcess","file","pdi"],"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"}