{"record":{"id":"6c4831aabcbb0e14","repo":"pentaho/pentaho-kettle","slug":"error-0003-unable-to-save-job","errorCode":"ERROR_0003_Unable_To_Save_Job","errorMessage":"JobEntryFileCompare.ERROR_0003_Unable_To_Save_Job","messagePattern":"JobEntryFileCompare\\.ERROR_0003_Unable_To_Save_Job","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/filecompare/JobEntryFileCompare.java","lineNumber":131,"sourceCode":"  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      filename1 = rep.getJobEntryAttributeString( id_jobentry, \"filename1\" );\n      filename2 = rep.getJobEntryAttributeString( id_jobentry, \"filename2\" );\n      addFilenameToResult = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_filename_result\" );\n    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryFileCompare.ERROR_0002_Unable_To_Load_Job_From_Repository\", 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(), \"filename1\", filename1 );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"filename2\", filename2 );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_filename_result\", addFilenameToResult );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryFileCompare.ERROR_0003_Unable_To_Save_Job\", id_job ), dbe );\n    }\n  }\n\n  public String getRealFilename1() {\n    return environmentSubstitute( getFilename1() );\n  }\n\n  public String getRealFilename2() {\n    return environmentSubstitute( getFilename2() );\n  }\n\n  /**\n   * Check whether 2 files have the same contents.\n   *\n   * @param file1\n   *          first file to compare\n   * @param file2","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/filecompare/JobEntryFileCompare.java#L113-L149","documentation":"Thrown by JobEntryFileCompare.saveRep when persisting the entry's attributes (filename1, filename2, add_filename_result) to the repository fails. A KettleDatabaseException is wrapped in a KettleException with a localized message carrying the job id. It means the repository write for this entry did not commit.","triggerScenarios":"Calling JobMeta.saveRep (or Job.save) against a database repository when the underlying insert/update of job entry attributes fails: connection loss, constraint violation, read-only repository.","commonSituations":"Repository DB down or network blip during save; insufficient DB user privileges; transaction lock from another Spoon session editing the same job.","solutions":["Check repository DB connectivity and retry the save","Verify the DB user has INSERT/UPDATE rights on r_jobentry_attribute","Look at the wrapped KettleDatabaseException cause for the exact SQL error","Close conflicting Spoon sessions holding locks on the same job"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check repository writability\nif (rep.isReadOnly()) { throw new IllegalStateException(\"repository is read-only\"); }","typeGuard":null,"tryCatchPattern":"try {\n    jobMeta.saveRep(rep, metaStore, id_job);\n} catch (KettleException e) {\n    logError(\"Save failed: \" + e.getMessage(), e);\n    // keep the in-memory JobMeta so the user can retry or export to XML\n}","preventionTips":["Confirm DB connectivity before long editing sessions","Grant the repository user INSERT/UPDATE on r_jobentry_attribute","Avoid two sessions editing the same job concurrently","Export jobs to XML as a backup before risky saves"],"tags":["repository","database","save"],"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"}