pentaho/pentaho-kettle · error · KettleException

JobPGPEncryptFiles.Error.Exception.UnableSaveRep

Error message

JobPGPEncryptFiles.Error.Exception.UnableSaveRep

What it means

JobEntryPGPEncryptFiles.saveRep wraps any KettleDatabaseException raised while persisting the entry's attributes (gpg location, userid, destination_filefolder, wildcard arrays) into a KettleException with the localized 'UnableSaveRep' message and the job id. It signals that the job entry could not be written to the repository; the database error is preserved as the cause.

Solutions

  1. Check the cause (KettleDatabaseException) for the specific SQL error and fix the repository DB issue (connectivity, permissions, disk space)
  2. Confirm the repository schema matches the installed Pentaho version and run any pending upgrade scripts
  3. Retry the save after restoring the connection; if rows are partially written, clean up orphan r_jobentry_attribute rows and re-save

Example fix

// before
entry.saveRep(rep, metaStore, idJob); // surfaces as UnableSaveRep
// after
try {
  entry.saveRep(rep, metaStore, idJob);
} catch (KettleException e) {
  logError("Could not save PGP encrypt entry to repository: " + e.getCause(), e);
  // notify user the job was not persisted
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before saveRep
if (rep == null || id_job == null) throw new KettleException("Repository or job id missing");
rep.connect(); // fail fast if DB unreachable

Try / catch

try {
  entry.saveRep(rep, metaStore, idJob);
} catch (KettleException e) {
  logError("Repository save failed: " + e.getCause(), e);
  // surface to user that the job was NOT persisted; retry after fixing DB
}

Prevention

When it happens

Trigger: Calling saveRep (directly or via saving a job) when a rep.saveJobEntryAttribute call throws KettleDatabaseException: repository connection lost, constraint violation, read-only database, or schema mismatch on r_jobentry_attribute.

Common situations: Repository database is read-only or out of space; DB session dropped during a long save; schema drift after a Pentaho upgrade; duplicate/foreign-key issues on the job entry rows.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/431e7096f40c7ea3. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/pgpencryptfiles/JobEntryPGPEncryptFiles.java:396

      rep
        .saveJobEntryAttribute(
          id_job, getObjectId(), "AddMovedDateBeforeExtension", AddMovedDateBeforeExtension );
      rep.saveJobEntryAttribute( id_job, getObjectId(), "asciiMode", asciiMode );

      // save the arguments...
      if ( source_filefolder != null ) {
        for ( int i = 0; i < source_filefolder.length; i++ ) {
          rep.saveJobEntryAttribute( id_job, getObjectId(), i, "action_type", getActionTypeCode( action_type[i] ) );
          rep.saveJobEntryAttribute( id_job, getObjectId(), i, "source_filefolder", source_filefolder[i] );
          rep.saveJobEntryAttribute( id_job, getObjectId(), i, "userid", userid[i] );
          rep
            .saveJobEntryAttribute(
              id_job, getObjectId(), i, "destination_filefolder", destination_filefolder[i] );
          rep.saveJobEntryAttribute( id_job, getObjectId(), i, "wildcard", wildcard[i] );
        }
      }
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString( PKG, "JobPGPEncryptFiles.Error.Exception.UnableSaveRep" )
        + id_job, dbe );
    }
  }

  public Result execute( Result previousResult, int nr ) {
    Result result = previousResult;
    List<RowMetaAndData> rows = result.getRows();
    RowMetaAndData resultRow = null;
    result.setNrErrors( 1 );
    result.setResult( false );

    try {

      NrErrors = 0;
      NrSuccess = 0;
      successConditionBroken = false;
      successConditionBrokenExit = false;
      limitFiles = Const.toInt( environmentSubstitute( getNrErrorsLessThan() ), 10 );

View on GitHub (pinned to f3058517a1)