{"record":{"id":"4c164eeb221054f0","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-of-type-create-file-to-the","errorCode":null,"errorMessage":"Unable to save job entry of type 'create file' to the repository for id_job=${id_job}","messagePattern":"Unable to save job entry of type 'create 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/createfile/JobEntryCreateFile.java","lineNumber":126,"sourceCode":"    try {\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n      failIfFileExists = rep.getJobEntryAttributeBoolean( id_jobentry, \"fail_if_file_exists\" );\n      addfilenameresult = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_filename_result\" );\n\n    } catch ( KettleException dbe ) {\n      throw new KettleException(\n        \"Unable to load job entry of type 'create file' from the repository for id_jobentry=\" + id_jobentry, 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(), \"fail_if_file_exists\", failIfFileExists );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_filename_result\", addfilenameresult );\n\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to save job entry of type 'create 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  public Result execute( Result previousResult, int nr ) throws KettleException {\n    Result result = previousResult;","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/createfile/JobEntryCreateFile.java#L108-L144","documentation":"JobEntryCreateFile.saveRep throws this KettleException when persisting the 'create file' entry's attributes to the repository fails for the given id_job. It wraps KettleDatabaseException thrown by rep.saveJobEntryAttribute calls.","triggerScenarios":"Calling saveRep when saving 'filename', 'fail_if_file_exists' or 'add_filename_result' to the repository fails — lost DB connection, constraint violations, read-only repository, or invalid job object id.","commonSituations":"Network interruption while saving a job to a remote repository DB; database quota/disk full; filenames longer than the VALUE_STR column; user lacking repository write privileges.","solutions":["Verify repository connectivity and retry saving the job.","Ensure the repository user has write permissions and the DB is writable.","Shorten the filename value if it may exceed repository column limits.","Check the chained KettleDatabaseException for the exact SQL failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (filename != null && filename.length() > 2000) throw new IllegalArgumentException(\"filename exceeds repository column size\");\nif (!rep.isConnected()) throw new IllegalStateException(\"Repository must be connected before saveRep\");","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} catch (KettleException e) {\n  logError(\"Repo save failed for create-file entry, id_job=\" + id_job + \": \" + e.getCause(), e);\n  // surface to user and offer retry; in-memory job is unaffected\n}","preventionTips":["Ensure stable DB connection when saving jobs","Check write permissions on the repository for the current user","Keep filenames within column length limits","Review chained KettleDatabaseException for SQL-level causes"],"tags":["pdi","kettle","repository","database-write"],"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"}