{"record":{"id":"37594d87d621a454","repo":"pentaho/pentaho-kettle","slug":"unable-to-write-log-entry-to-file-logfile","errorCode":null,"errorMessage":"Unable to write log entry to file [ + logfile + ]","messagePattern":"Unable to write log entry to file \\[ \\+ logfile \\+ \\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java","lineNumber":839,"sourceCode":"  @Override\n  public void insertJobEntryDatabase( ObjectId id_job, ObjectId id_jobentry, ObjectId id_database ) throws KettleException {\n  }\n\n  public void insertJobNote( ObjectId id_job, ObjectId id_note ) throws KettleException {\n  }\n\n  @Override\n  public ObjectId insertLogEntry( String description ) throws KettleException {\n    String logfile = calcDirectoryName( null ) + LOG_FILE;\n    try {\n      OutputStream outputStream = KettleVFS.getInstance( DefaultBowl.getInstance() ).getOutputStream( logfile, true );\n      outputStream.write( description.getBytes() );\n      outputStream.write( Const.CR.getBytes() );\n      outputStream.close();\n\n      return new StringObjectId( logfile );\n    } catch ( IOException e ) {\n      throw new KettleException( \"Unable to write log entry to file [\" + logfile + \"]\" );\n    }\n  }\n\n  @Override\n  public void insertStepDatabase( ObjectId id_transformation, ObjectId id_step, ObjectId id_database ) throws KettleException {\n\n  }\n\n  public void insertTransNote( ObjectId id_transformation, ObjectId id_note ) throws KettleException {\n\n  }\n\n  public void insertTransStepCondition( ObjectId id_transformation, ObjectId id_step, ObjectId id_condition ) throws KettleException {\n\n  }\n\n  public ObjectId insertTransformationCluster( ObjectId id_transformation, ObjectId id_cluster ) throws KettleException {\n","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java#L821-L857","documentation":"Thrown by KettleFileRepository's insertLogEntry: when writing a log entry line to the log file in the repository fails with an IOException, it is wrapped in this KettleException naming the target logfile. Unlike most siblings it discards the cause object, so the original IOException is not chained.","triggerScenarios":"Calling insertLogEntry(description) when the log file path cannot be created or written: unwritable directory, disk full, filename from a bad log level id, or the VFS file object cannot be opened for output.","commonSituations":"Repository folder is read-only; disk quota exceeded on the repository volume; log file locked by another process; invalid logfile name derived from a corrupted directory id.","solutions":["Ensure the repository directory backing the log file is writable by the process","Free disk space / raise quota on the repository volume","Check no other process holds a conflicting lock on the log file","Since the cause is dropped, reproduce with logging enabled to capture the original IOException stack"],"exampleFix":"// before (in a caller)\nrepository.insertLogEntry(\"job started\");\n// after\ntry {\n  repository.insertLogEntry(\"job started\");\n} catch (KettleException e) {\n  log.warn(\"Repository log entry not written; continuing\", e); // do not fail the job for logging\n}","handlingStrategy":"try-catch","validationCode":"File repoDir = new File(repoBaseDirectory);\nif (!repoDir.canWrite()) throw new KettleException(\"Repository not writable; log entries cannot be stored\");\nif (repoDir.getFreeSpace() < 10_000_000) throw new KettleException(\"Low disk space on repository volume\");","typeGuard":null,"tryCatchPattern":"try {\n  repository.insertLogEntry(\"job started\");\n} catch (KettleException e) {\n  logger.warn(\"Repository log entry skipped (non-fatal): \" + e.getMessage()); // logging failure should not fail the job\n}","preventionTips":["Treat repository logging as best-effort: catch and continue","Keep the repository volume writable and monitor free space","Enable app-level logging so failures are visible even when repo log writes fail"],"tags":["file-repository","kettle","file-write","io-exception"],"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"}