{"record":{"id":"ed65c0dc57202bb0","repo":"pentaho/pentaho-kettle","slug":"accessoutputmeta-exception-filedoesnotexist","errorCode":"AccessOutputMeta.Exception.FileDoesNotExist","errorMessage":"AccessOutputMeta.Exception.FileDoesNotExist","messagePattern":"AccessOutputMeta\\.Exception\\.FileDoesNotExist","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":250,"sourceCode":"      remarks.add( cr );\n    }\n  }\n\n  public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,\n    TransMeta transMeta, Trans trans ) {\n    return new AccessOutput( stepMeta, stepDataInterface, cnr, transMeta, trans );\n  }\n\n  public StepDataInterface getStepData() {\n    return new AccessOutputData();\n  }\n\n  public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {\n    String realFilename = space.environmentSubstitute( filename );\n    File file = new File( realFilename );\n    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  }","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessoutput/AccessOutputMeta.java#L232-L268","documentation":"AccessOutputMeta.getRequiredFields resolves the configured filename with environment substitution and requires it to be an existing regular file, because it must open the Access database read-only to read table metadata. If the file does not exist or is not a file, it throws KettleException with AccessOutputMeta.Exception.FileDoesNotExist.","triggerScenarios":"Calling getRequiredFields (via the fields/metadata lookup) when the substituted filename points to a nonexistent path, a directory, or the file was deleted/moved after configuration.","commonSituations":"Typo in the .mdb/.accdb path; file moved between environments; environment variable not set so substitution yields a wrong path; running on a server where the file share is not mounted.","solutions":["Verify the configured filename points to an existing .mdb/.accdb file","Check that environment variables used in the path are defined at runtime","Confirm the file is mounted/accessible from the machine running the transformation","Fix the path to a directory vs file mixup","Create or restore the Access database file"],"exampleFix":"// before\nmeta.setFilename(\"${OUTPUT_DIR}/data.mdb\");\n// after\n// ensure the variable resolves to an existing file\nFile f = new File(space.environmentSubstitute(\"${OUTPUT_DIR}/data.mdb\"));\nif (!f.exists() || !f.isFile()) throw new IllegalStateException(\"Access DB missing: \" + f);\nmeta.setFilename(\"${OUTPUT_DIR}/data.mdb\");","handlingStrategy":"validation","validationCode":"String real = space.environmentSubstitute(meta.getFilename());\nFile f = new File(real);\nif (!f.exists() || !f.isFile()) {\n  throw new IllegalArgumentException(\"Access DB file not found: \" + real);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve all variables in paths before running, e.g. log the substituted path","Verify files exist on the execution node, not just the design machine","Use shared/network paths consistently mounted on all nodes","Keep the Access file with the deployment artifacts"],"tags":["file","access","configuration","pdi"],"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"}