pentaho/pentaho-kettle · error · KettleException

JobEntryEval.UnableToSaveToRepo

Error message

JobEntryEval.UnableToSaveToRepo

What it means

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.

Solutions

  1. Inspect the cause KettleDatabaseException for the underlying SQL/JDBC error.
  2. Verify the repository database is writable and has sufficient space; check r_jobentry_attribute column sizes against the script length.
  3. Ensure the job entry has a valid ObjectId (save the job so IDs are assigned).
  4. Retry the save after restoring the DB connection; upgrade the repository schema if outdated.
Defensive patterns

Strategy: try-catch

Validate before calling

// Check writability and object id before saving
if (jobMeta.getObjectId() == null) {
  throw new IllegalStateException("Job must be saved/assigned an id before saveRep");
}
if (!rep.connect()) {
  throw new IllegalStateException("Repository not reachable");
}

Try / catch

try {
  jobMeta.save();
} catch (KettleException e) {
  if (e.getCause() instanceof KettleDatabaseException) {
    logError("Failed to save Eval entry attributes: " + e.getMessage(), e);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/eval/JobEntryEval.java:105

  }

  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
    try {
      script = rep.getJobEntryAttributeString( id_jobentry, "script" );
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString( PKG, "JobEntryEval.UnableToLoadFromRepo", String
        .valueOf( id_jobentry ) ), dbe );
    }
  }

  // Save the attributes of this job entry
  //
  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {
    try {
      rep.saveJobEntryAttribute( id_job, getObjectId(), "script", script );
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString( PKG, "JobEntryEval.UnableToSaveToRepo", String
        .valueOf( id_job ) ), dbe );
    }
  }

  public void setScript( String s ) {
    script = s;
  }

  public String getScript() {
    return script;
  }

  /**
   * Evaluate the result of the execution of previous job entry.
   *
   * @param result
   *          The result to evaulate.
   * @param prev_result

View on GitHub (pinned to f3058517a1)