{"record":{"id":"b77d24df640fd5eb","repo":"pentaho/pentaho-kettle","slug":"jobentryeval-unabletosavetorepo","errorCode":null,"errorMessage":"JobEntryEval.UnableToSaveToRepo","messagePattern":"JobEntryEval\\.UnableToSaveToRepo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/eval/JobEntryEval.java","lineNumber":105,"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      script = rep.getJobEntryAttributeString( id_jobentry, \"script\" );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntryEval.UnableToLoadFromRepo\", String\n        .valueOf( id_jobentry ) ), dbe );\n    }\n  }\n\n  // Save the attributes of this job entry\n  //\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"script\", script );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntryEval.UnableToSaveToRepo\", String\n        .valueOf( id_job ) ), dbe );\n    }\n  }\n\n  public void setScript( String s ) {\n    script = s;\n  }\n\n  public String getScript() {\n    return script;\n  }\n\n  /**\n   * Evaluate the result of the execution of previous job entry.\n   *\n   * @param result\n   *          The result to evaulate.\n   * @param prev_result","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/eval/JobEntryEval.java#L87-L123","documentation":"JobEntryEval.saveRep() writes the 'script' attribute of this job entry to the Kettle repository; a KettleDatabaseException is rethrown as a KettleException with localized message 'JobEntryEval.UnableToSaveToRepo' plus the job id. It means saving the job failed at the point of persisting this entry's script.","triggerScenarios":"Saving a job to a repository (saveRep invoked via JobMeta.save) where rep.saveJobEntryAttribute(id_job, getObjectId(), \"script\", script) throws KettleDatabaseException, e.g. constraint violation, oversized value, or connection loss mid-save.","commonSituations":"Repository DB read-only or out of space; script exceeds column size limit; getObjectId() null for an unsaved entry; database connection dropped during save; schema migration missing the attribute table.","solutions":["Inspect the cause KettleDatabaseException for the underlying SQL/JDBC error.","Verify the repository database is writable and has sufficient space; check r_jobentry_attribute column sizes against the script length.","Ensure the job entry has a valid ObjectId (save the job so IDs are assigned).","Retry the save after restoring the DB connection; upgrade the repository schema if outdated."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check writability and object id before saving\nif (jobMeta.getObjectId() == null) {\n  throw new IllegalStateException(\"Job must be saved/assigned an id before saveRep\");\n}\nif (!rep.connect()) {\n  throw new IllegalStateException(\"Repository not reachable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobMeta.save();\n} catch (KettleException e) {\n  if (e.getCause() instanceof KettleDatabaseException) {\n    logError(\"Failed to save Eval entry attributes: \" + e.getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["Ensure the repository user has write grants and the DB has free space.","Keep scripts within the attribute column size limits.","Save via the API so ObjectIds are assigned before attribute writes.","Retry saves after transient connection loss."],"tags":["database","repository","persistence","kettle"],"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"}