{"record":{"id":"169f343dedd5714b","repo":"pentaho/pentaho-kettle","slug":"jobentrymailvalidator-meta-unabletosavetorep","errorCode":null,"errorMessage":"JobEntryMailValidator.Meta.UnableToSaveToRep","messagePattern":"JobEntryMailValidator\\.Meta\\.UnableToSaveToRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail-validator/impl/src/main/java/org/pentaho/di/job/entries/mailvalidator/JobEntryMailValidator.java","lineNumber":198,"sourceCode":"      emailSender = rep.getJobEntryAttributeString( id_jobentry, \"emailSender\" );\n      emailAddress = rep.getJobEntryAttributeString( id_jobentry, \"emailAddress\" );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntryMailValidator.Meta.UnableToLoadFromRep\" )\n        + 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(), \"smtpCheck\", smtpCheck );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"timeout\", timeout );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"defaultSMTP\", defaultSMTP );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"emailSender\", emailSender );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"emailAddress\", emailAddress );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntryMailValidator.Meta.UnableToSaveToRep\" )\n        + id_job, dbe );\n    }\n  }\n\n  /**\n   * Execute this job entry and return the result. In this case it means, just set the result boolean in the Result\n   * class.\n   *\n   * @param previousResult\n   *          The result of the previous execution\n   * @return The Result of the execution.\n   */\n  public Result execute( Result previousResult, int nr ) {\n    Result result = previousResult;\n    result.setNrErrors( 1 );\n    result.setResult( false );\n\n    String realEmailAddress = environmentSubstitute( emailAddress );","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-validator/impl/src/main/java/org/pentaho/di/job/entries/mailvalidator/JobEntryMailValidator.java#L180-L216","documentation":"JobEntryMailValidator.saveRep() throws this KettleException when writing the job entry's attributes to the Kettle repository fails with a KettleDatabaseException. The message key is concatenated with the job id for identification. The original database exception is attached as the cause.","triggerScenarios":"Calling saveRep() when the repository database connection fails, a required column is missing/null, or a constraint violation occurs while saving smtpCheck, timeout, defaultSMTP, emailSender or emailAddress.","commonSituations":"Repository database is read-only or disk full; schema mismatch after a Pentaho version upgrade; transaction rollback in the repository during job save; invalid characters in attribute values.","solutions":["Inspect getCause() (KettleDatabaseException) to find the exact SQL/database failure and fix it (connectivity, permissions, disk space).","Verify the repository schema matches the Pentaho version in use.","Retry saving the job from Spoon after restoring database access.","Export the job to XML as a workaround if the repository remains unavailable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before saveRep: ensure the repository is writable\nif ( repository == null || repository.isReadOnly() ) {\n  throw new KettleException( \"Repository missing or read-only; cannot save job entry\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.saveRep( rep, id_job, id_jobentry );\n} catch ( KettleException e ) {\n  logError( \"Failed to save mail validator job entry\", e.getCause() );\n  throw e;\n}","preventionTips":["Confirm the repository database has free disk space and write permissions.","Run schema upgrades after Pentaho version changes.","Save the job via Spoon to validate settings before programmatic saves.","Export jobs to XML as a backup strategy."],"tags":["repository","database","job-entry","persistence"],"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"}