{"record":{"id":"b432150323f5024e","repo":"pentaho/pentaho-kettle","slug":"error-0003-cannot-save-job-entry-jobentrytalendjobexec","errorCode":"ERROR_0003_Cannot_Save_Job_Entry","errorMessage":"JobEntryTalendJobExec.ERROR_0003_Cannot_Save_Job_Entry","messagePattern":"JobEntryTalendJobExec\\.ERROR_0003_Cannot_Save_Job_Entry","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/talendjobexec/JobEntryTalendJobExec.java","lineNumber":126,"sourceCode":"  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n      className = rep.getJobEntryAttributeString( id_jobentry, \"class_name\" );\n    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryTalendJobExec.ERROR_0002_Cannot_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(), \"filename\", filename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"class_name\", className );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryTalendJobExec.ERROR_0003_Cannot_Save_Job_Entry\", 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 ) {\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/talendjobexec/JobEntryTalendJobExec.java#L108-L144","documentation":"Thrown by JobEntryTalendJobExec.saveRep when persisting the Talend job entry's attributes (filename, class_name) to the Kettle repository fails with a KettleDatabaseException. It wraps the low-level database error with the job's ObjectId for context. It indicates the repository storage layer rejected the write, not a problem with the Talend job itself.","triggerScenarios":"Calling saveRep on a JobEntryTalendJobExec when the repository connection is broken, the R_JOBENTRY_ATTRIBUTE table is missing/corrupt, or a repository-level constraint (e.g. null/oversized attribute value) is violated while saving 'filename' or 'class_name'.","commonSituations":"Saving a job to a database repository whose connection dropped mid-save; a mis-migrated Pentaho repository schema missing job entry attribute tables; saving before the entry has been assigned an ObjectId; database permissions revoked on the repository tables.","solutions":["Verify the repository database connection and retry the save operation","Check the repository schema is fully migrated (R_JOBENTRY_ATTRIBUTE exists and is writable)","Ensure the job entry has a valid ObjectId (it has been added to a saved job) before saveRep","Inspect the wrapped KettleDatabaseException cause for the specific SQL error and fix permissions/constraints accordingly"],"exampleFix":"// before\njobEntry.saveRep( rep, metaStore, id_job ); // fails with ERROR_0003\n// after\nif ( rep != null && rep.isConnected() ) {\n  rep.connect( envUser, envPass );\n  jobEntry.saveRep( rep, metaStore, id_job );\n}","handlingStrategy":"try-catch","validationCode":"if ( rep == null || !rep.isConnected() ) { throw new IllegalStateException( \"Repository not connected\" ); }","typeGuard":null,"tryCatchPattern":"try { jobEntry.saveRep( rep, metaStore, id_job ); } catch ( KettleException e ) { log.error( \"Failed to save Talend job entry \" + id_job, e.getCause() ); throw e; }","preventionTips":["Confirm repository connectivity before batch saves","Ensure job entries have ObjectIds (job saved) before saveRep","Keep repository schema migrated to the runtime version","Use a repository account with write permissions"],"tags":["kettle","repository","database"],"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"}