{"record":{"id":"0661f771f15ee6da","repo":"pentaho/pentaho-kettle","slug":"fileerrorhandlermissingfiles-exception","errorCode":"FileErrorHandlerMissingFiles.Exception.CouldNotCreateNonExistantFile","errorMessage":"FileErrorHandlerMissingFiles.Exception.CouldNotCreateNonExistantFile","messagePattern":"FileErrorHandlerMissingFiles\\.Exception\\.CouldNotCreateNonExistantFile","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/errorhandling/FileErrorHandlerMissingFiles.java","lineNumber":50,"sourceCode":"  public static final String THIS_FILE_WAS_NOT_ACCESSIBLE = BaseMessages.getString(\n    PKG, \"FileErrorHandlerMissingFiles.FILE_WAS_NOT_ACCESSIBLE\" );\n\n  public FileErrorHandlerMissingFiles( Date date, String destinationDirectory, String fileExtension,\n    String encoding, BaseStep baseStep ) {\n    super( date, destinationDirectory, fileExtension, encoding, baseStep );\n  }\n\n  public void handleLineError( long lineNr, String filePart ) {\n\n  }\n\n  public void handleNonExistantFile( FileObject file ) throws KettleException {\n    handleFile( file );\n    try {\n      getWriter( NO_PARTS ).write( THIS_FILE_DOES_NOT_EXIST );\n      getWriter( NO_PARTS ).write( Const.CR );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"FileErrorHandlerMissingFiles.Exception.CouldNotCreateNonExistantFile\" )\n        + file.getName().getURI(), e );\n    }\n  }\n\n  public void handleNonAccessibleFile( FileObject file ) throws KettleException {\n    handleFile( file );\n    try {\n      getWriter( NO_PARTS ).write( THIS_FILE_WAS_NOT_ACCESSIBLE );\n      getWriter( NO_PARTS ).write( Const.CR );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"FileErrorHandlerMissingFiles.Exception.CouldNotCreateNonAccessibleFile\" )\n        + file.getName().getURI(), e );\n    }\n  }\n\n}","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/errorhandling/FileErrorHandlerMissingFiles.java#L32-L68","documentation":"KettleException thrown by FileErrorHandlerMissingFiles.handleNonExistantFile() when recording a missing (non-existent) input file in the 'missing files' lineage file fails. The record of THIS_FILE_DOES_NOT_EXIST could not be written because the writer/file itself could not be created or written.","triggerScenarios":"handleNonExistantFile(file) called by file-input steps that allow missing files; getWriter(NO_PARTS).write(...) throws — error lineage file location invalid, unwritable, or stream fails after creation.","commonSituations":"Wildcard file input where some matched files vanished between listing and processing; error-lineage directory misconfigured so even the missing-file record can't be written; permission issues on lineage directory.","solutions":["Fix the error-handling file directory (exists, writable) — check the chained cause","Verify whether the missing input file itself is expected; adjust the file filter/wildcard","Grant the Kettle process write permission to the lineage directory","If missing files are normal, keep lineage enabled but point it to reliable local storage"],"exampleFix":"// before: lineage dir read-only\nFileErrorHandlerMissingFiles(\"/mnt/ro/lineage\", ...)\n// after\nFileErrorHandlerMissingFiles(\"/var/log/kettle/lineage\", ...)","handlingStrategy":"validation","validationCode":"// Pre-flight lineage directory before the file-input step starts\nFileObject lineageDir = fsManager.resolveFile(lineageDirUri);\nif (!lineageDir.exists() || !lineageDir.isWriteable()) {\n  throw new IllegalStateException(\"Missing-file lineage dir unusable: \" + lineageDirUri);\n}","typeGuard":null,"tryCatchPattern":"try {\n  errorHandler.handleNonExistantFile(missingFile);\n} catch (KettleException e) {\n  log.error(\"Cannot record missing file \" + missingFile.getName().getURI()\n    + \": \" + e.getMessage(), e);\n  throw e;\n}","preventionTips":["Create and test the lineage directory in deployment scripts","Re-check wildcard matches for transient/vanishing files (e.g. producer still writing)","Run Kettle as a user with write access to lineage directories"],"tags":["file-io","missing-files","error-handling"],"backgroundTag":"file-write-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"}