{"record":{"id":"20dcdbb36c3d873f","repo":"pentaho/pentaho-kettle","slug":"accessinput-error-errorreadingfile","errorCode":"AccessInput.Error.ErrorReadingFile","errorMessage":"AccessInput.Error.ErrorReadingFile","messagePattern":"AccessInput\\.Error\\.ErrorReadingFile","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessinput/AccessInput.java","lineNumber":209,"sourceCode":"      // Add Uri\n      if ( meta.getUriField() != null && meta.getUriField().length() > 0 ) {\n        r[rowIndex++] = data.uriName;\n      }\n      // Add RootUri\n      if ( meta.getRootUriField() != null && meta.getRootUriField().length() > 0 ) {\n        r[rowIndex++] = data.rootUriName;\n      }\n\n      RowMetaInterface irow = getInputRowMeta();\n\n      data.previousRow = irow == null ? r : irow.cloneRow( r ); // copy it to make\n      // surely the next step doesn't change it in between...\n\n      incrementLinesInput();\n      data.rownr++;\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AccessInput.Error.ErrorReadingFile\" ), e );\n    }\n\n    return r;\n  }\n\n  private boolean openNextFile() {\n    try {\n      if ( !meta.isFileField() ) {\n        // finished processing!\n        if ( data.filenr >= data.files.nrOfFiles() ) {\n          if ( log.isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"AccessInput.Log.FinishedProcessing\" ) );\n          }\n          return false;\n        }\n\n        // Is this the last file?\n        data.last_file = ( data.filenr == data.files.nrOfFiles() - 1 );","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessinput/AccessInput.java#L191-L227","documentation":"Generic KettleException thrown in AccessInput.getOneRow when any exception occurs while reading a row from the currently open MS Access file via Jackcess (getting the table, columns, or values). It wraps the original exception with the localized 'Error reading file' message, so the cause chain holds the real problem.","triggerScenarios":"Any failure inside the row-reading loop of the Access Input step: the .mdb/.accdb file is corrupt or locked by another process, the configured table disappears mid-run, a column read fails (type unsupported by Jackcess), or the database handle was closed unexpectedly.","commonSituations":"File locked by an open MS Access session; corrupt Access database (needs Compact & Repair); password-protected Access files unsupported by the configured Jackcess mode; table renamed/deleted between design-time and run-time; 32-bit Jet vs Jackcess incompatibilities.","solutions":["Inspect the wrapped cause exception (e.getCause()) for the real error (e.g. 'Table not found', 'Incorrect password format', I/O error).","Close any MS Access sessions locking the .mdb/.accdb file and ensure the file is not read-locked on a network share.","Run Compact & Repair in MS Access on the database, or export the data to a fresh file.","Verify the table name configured in the Access Input step still exists in each file being processed.","If the file is .accdb with complex encrypted columns, check Jackcess/JackcessEncrypt version support in the PDI installation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before running: verify each configured file is readable and not locked\nfor ( String f : files ) {\n  File file = new File( f );\n  if ( !file.canRead() ) throw new IllegalStateException( \"Unreadable: \" + f );\n  try ( RandomAccessFile raf = new RandomAccessFile( file, \"rw\" ) ) { /* lock probe */ }\n}","typeGuard":null,"tryCatchPattern":"try { /* run transformation / preview rows */ } catch ( KettleException e ) { Throwable cause = e.getCause(); logError( \"Access read failed: \" + ( cause != null ? cause.getMessage() : e.getMessage() ), e ); }","preventionTips":["Close MS Access sessions before running PDI against the file","Run Compact & Repair periodically on Access databases","Preview rows in Spoon before production runs to catch table/column changes","Pin compatible Jackcess versions in the PDI classpath"],"tags":["kettle","ms-access","file-read","jackcess","step"],"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"}