{"record":{"id":"3631622313540612","repo":"pentaho/pentaho-kettle","slug":"jobentrysimple-error-exception-unablesaverep","errorCode":"JobEntrySimple.Error.Exception.UnableSaveRep","errorMessage":"JobEntrySimple.Error.Exception.UnableSaveRep","messagePattern":"JobEntrySimple\\.Error\\.Exception\\.UnableSaveRep","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/simpleeval/JobEntrySimpleEval.java","lineNumber":417,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"fieldname\", fieldname );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"variablename\", variablename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"fieldtype\", getFieldTypeCode( fieldtype ) );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"mask\", mask );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"comparevalue\", comparevalue );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"minvalue\", minvalue );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"maxvalue\", maxvalue );\n      rep.saveJobEntryAttribute(\n        id_job, getObjectId(), \"successcondition\", getSuccessConditionCode( successcondition ) );\n      rep\n        .saveJobEntryAttribute(\n          id_job, getObjectId(), \"successnumbercondition\",\n          getSuccessNumberConditionCode( successnumbercondition ) );\n      rep.saveJobEntryAttribute(\n        id_job, getObjectId(), \"successbooleancondition\",\n        getSuccessBooleanConditionCode( successbooleancondition ) );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"successwhenvarset\", successwhenvarset );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntrySimple.Error.Exception.UnableSaveRep\" )\n        + id_job, dbe );\n    }\n  }\n\n  @Override\n  public Result execute( Result previousResult, int nr ) throws KettleException {\n    Result result = previousResult;\n\n    result.setNrErrors( 1 );\n    result.setResult( false );\n\n    String sourcevalue = null;\n    switch ( valuetype ) {\n      case VALUE_TYPE_FIELD:\n        List<RowMetaAndData> rows = result.getRows();\n        RowMetaAndData resultRow = null;\n        if ( isDetailed() ) {\n          logDetailed( BaseMessages.getString( PKG, \"JobEntrySimpleEval.Log.ArgFromPrevious.Found\", ( rows != null","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/simpleeval/JobEntrySimpleEval.java#L399-L435","documentation":"JobEntrySimpleEval.saveRep wraps any KettleDatabaseException raised while writing the job entry's attributes ('fieldname', datatype, success condition codes, 'successwhenvarset') to the repository, rethrowing as KettleException with UnableSaveRep and the id_job. It means the job entry's configuration could not be persisted.","triggerScenarios":"Calling saveRep on a JobEntrySimpleEval when Repository.saveJobEntryAttribute throws KettleDatabaseException - e.g. repository connection lost, constraint violation, read-only DB user, or disk full on the repository DB.","commonSituations":"Saving a job when the repository session has expired; DB user lacks INSERT/UPDATE privileges on R_JOBENTRY_ATTRIBUTE; repository schema out of date after upgrade; unique-constraint clashes.","solutions":["Check the chained KettleDatabaseException for the root SQL error (permissions, constraints, connectivity).","Reconnect to the repository (re-login) and retry saving.","Verify the DB user has write privileges on the job entry attribute tables.","Run the repository upgrade/repair tool if the schema version mismatches."],"exampleFix":"// before\njobEntry.saveRep(rep, metaStore, idJob); // may throw KettleException wrapping KettleDatabaseException\n// after\ntry {\n  jobEntry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  throw new KettleException(\"Persist failed for job entry; verify repository connection and write access\", e);\n}","handlingStrategy":"try-catch","validationCode":"// Ensure repository is writable before save\nif (rep == null || rep.isReadOnly()) throw new KettleException(\"Repository not writable\");","typeGuard":null,"tryCatchPattern":"try {\n  entry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logger.error(\"Save failed (id_job=\" + idJob + \"), cause=\" + e.getCause(), e);\n  // offer retry after reconnect\n}","preventionTips":["Re-login to the repository before long editing sessions.","Confirm DB user has INSERT/UPDATE rights.","Run repository upgrades after Pentaho version changes.","Monitor DB disk space and tablespace usage."],"tags":["kettle","repository","persistence","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"}