{"record":{"id":"a120977ea96d078f","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-of-type-wait-for-file-to-the","errorCode":null,"errorMessage":"Unable to save job entry of type 'wait for file' to the repository for id_job=","messagePattern":"Unable to save job entry of type 'wait for file' to the repository for id_job=","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/waitforfile/JobEntryWaitForFile.java","lineNumber":144,"sourceCode":"      fileSizeCheck = rep.getJobEntryAttributeBoolean( id_jobentry, \"file_size_check\" );\n      addFilenameToResult = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_filename_result\" );\n    } catch ( KettleException dbe ) {\n      throw new KettleException(\n        \"Unable to load job entry of type 'wait for file' from the repository for id_jobentry=\" + id_jobentry,\n        dbe );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"filename\", filename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"maximum_timeout\", maximumTimeout );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"check_cycle_time\", checkCycleTime );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"success_on_timeout\", successOnTimeout );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"file_size_check\", fileSizeCheck );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_filename_result\", addFilenameToResult );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to save job entry of type 'wait for file' to the repository for id_job=\"\n        + id_job, dbe );\n    }\n  }\n\n  public void setFilename( String filename ) {\n    this.filename = filename;\n  }\n\n  public String getFilename() {\n    return filename;\n  }\n\n  public String getRealFilename() {\n    return environmentSubstitute( getFilename() );\n  }\n\n  // Utility to mark the result as unsuccessful and track errors\n  private void registerFailure( Result result ) {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/waitforfile/JobEntryWaitForFile.java#L126-L162","documentation":"JobEntryWaitForFile.saveRep() wraps a KettleDatabaseException from rep.saveJobEntryAttribute(...) into a KettleException with message \"Unable to save job entry of type 'wait for file' to the repository for id_job=\" plus the id. The entry's wait-for-file settings could not be persisted to the repository database.","triggerScenarios":"Calling saveRep(rep, metaStore, id_job) when any of the saveJobEntryAttribute calls for 'maximum_timeout', 'check_cycle_time', 'success_on_timeout', 'file_size_check', 'add_filename_result' fails (DB down, constraint, permissions).","commonSituations":"Repository DB out of space or read-only; concurrent lock contention in R_JOBENTRY_ATTRIBUTE; dropped network connection mid-save; insufficient repository user privileges.","solutions":["Confirm repository DB writability and user grants on R_JOBENTRY_ATTRIBUTE.","Read the cause KettleDatabaseException for the exact SQL failure (deadlock/lock timeout/constraint) and resolve it.","Retry the save; if persistent, export the job to .kjb and repair repository connectivity.","Check DBA alerts for the repository database (space, locks, replication lag)."],"exampleFix":"// before: blind retry loop\nfor (int i=0;i<3;i++) { try { entry.saveRep(rep, metaStore, id); break; } catch (KettleException e) {} }\n// after: check connectivity then save once, log cause\ntry {\n  entry.saveRep(rep, metaStore, id);\n} catch ( KettleException e ) {\n  logError(\"Save failed: \" + e.getCause().getMessage(), e);\n  throw e;\n}","handlingStrategy":"retry","validationCode":"// Ensure repository is connected and writable before saveRep\nif ( !rep.isConnected() || rep.isReadOnly() )\n  throw new KettleException(\"Repository not available for saving\");","typeGuard":"boolean saveable(Repository rep, ObjectId id_job) {\n  return rep != null && rep.isConnected() && !rep.isReadOnly() && id_job != null;\n}","tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} catch ( KettleException e ) {\n  if ( e.getCause() instanceof KettleDatabaseException ) {\n    // transient DB issue: retry once after reconnect\n    rep.disconnect(); rep.connect(user, pass);\n    jobEntry.saveRep(rep, metaStore, id_job);\n  } else { throw e; }\n}","preventionTips":["Enable connection retry/pooling on the repository datasource.","Resolve lock contention before saving shared jobs.","Monitor R_JOBENTRY_ATTRIBUTE table growth and space.","Always inspect e.getCause() for the SQL-level error."],"tags":["database","repository","kettle","persistence"],"backgroundTag":"database-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"}