pentaho/pentaho-kettle · error · KettleException

JobEntryCheckFilesLocked.UnableToSaveToRepo

Error message

JobEntryCheckFilesLocked.UnableToSaveToRepo

What it means

JobEntryCheckFilesLocked.saveRep wraps any KettleDatabaseException raised while saving the entry's per-row name/filemask attributes into the repository as this KettleException, identifying the target job by id_job.

Solutions

  1. Read the chained KettleDatabaseException for the SQL/root cause
  2. Verify repository DB connectivity, write permissions and free space
  3. Clean orphaned r_jobentry_attribute rows for the failing entry and re-save
  4. Re-run repository upgrade scripts if the schema is out of date

Example fix

// before
try { entry.saveRep(rep, metaStore, idJob); } catch (Exception ignore) {}
// after
try {
  entry.saveRep(rep, metaStore, idJob);
} catch (KettleException e) {
  log.error("Save failed for job " + idJob + ": " + e.getCause(), e); // then retry after fixing DB
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check repository writability before saveRep
if (!rep.isConnected()) throw new IllegalStateException("Repository not connected");

Try / catch

try {
  entry.saveRep(rep, metaStore, idJob);
} catch (KettleException e) {
  log.error("Repo save failed for job " + idJob + ": " + e.getCause(), e);
  // retry after fixing DB connectivity/permissions
}

Prevention

When it happens

Trigger: Calling saveRep when rep.saveJobEntryAttribute fails — repository DB down, constraint violation, transaction rollback, or connection dropped while writing r_jobentry_attribute rows.

Common situations: Repository database read-only or out of space; network blip during save; repository schema mismatch after PDI upgrade; duplicate key from a partially failed earlier save.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/checkfilelocked/JobEntryCheckFilesLocked.java:190

        PKG, "JobEntryCheckFilesLocked.UnableToLoadFromRepo", String.valueOf( idJobEntry ) ), dbe );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId idJob ) throws KettleException {
    try {

      rep.saveJobEntryAttribute( idJob, getObjectId(), ARG_FROM_PREVIOUS_ATTR, argFromPrevious );
      rep.saveJobEntryAttribute( idJob, getObjectId(), INCLUDE_SUBFOLDERS_ATTR, includeSubfolders );

      // save the arguments...
      if ( arguments != null ) {
        for ( int i = 0; i < arguments.length; i++ ) {
          rep.saveJobEntryAttribute( idJob, getObjectId(), i, NAME_ATTR, arguments[i] );
          rep.saveJobEntryAttribute( idJob, getObjectId(), i, FILE_MASK_ATTR, filemasks[i] );
        }
      }
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "JobEntryCheckFilesLocked.UnableToSaveToRepo", String.valueOf( idJob ) ), dbe );
    }
  }

  public Result execute( Result previousResult, int nr ) {

    Result result = previousResult;
    List<RowMetaAndData> rows = result.getRows();

    oneFileLocked = false;
    result.setResult( true );

    try {
      if ( argFromPrevious  && isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "JobEntryCheckFilesLocked.FoundPreviousRows", String
          .valueOf( ( rows != null ? rows.size() : 0 ) ) ) );
      }

View on GitHub (pinned to f3058517a1)