pentaho/pentaho-kettle · error · KettleException

AddSequenceMeta.Exception.UnableToSaveStepInfo

Error message

AddSequenceMeta.Exception.UnableToSaveStepInfo

What it means

AddSequenceMeta.saveRep() persists the step's settings to the repository; any Exception during attribute insertion or the insertStepDatabase call is wrapped in a KettleException with this message plus the step id. It means the step metadata could not be saved, so the transformation may be saved incompletely in the repository.

Solutions

  1. Check repository database availability and connection settings; retry the save once connectivity is restored
  2. Verify the repository user has INSERT/UPDATE permissions on r_step_attribute and related tables
  3. Ensure the step's referenced database connection is saved and has a valid ObjectId before saving the step
  4. Review the wrapped cause 'e' for the specific SQL failure (constraint, lock, quota) and fix accordingly

Example fix

// before: saving step referencing an unsaved database meta
stepMeta.getDatabaseMeta().setObjectId(null);
rep.saveStep(...);
// after: persist the database connection first, then the step
RepositoryObject db = rep.saveDatabaseMeta(jobMeta.getDatabaseMeta());
stepMeta.getDatabaseMeta().setObjectId(db.getObjectId());
rep.saveStep(...);
Defensive patterns

Strategy: try-catch

Validate before calling

if (rep == null || id_step == null) throw new IllegalStateException("Repository and step id must be resolved before saving");
if (meta.getDatabase() != null && meta.getDatabase().getObjectId() == null)
  throw new IllegalStateException("Linked database connection is not saved; save it before the step");

Type guard

boolean readyToSave(AddSequenceMeta m) {
  return m != null && (m.getDatabase() == null || m.getDatabase().getObjectId() != null);
}

Try / catch

try {
  meta.saveRep(rep, metaStore, idTransformation, idStep);
} catch (KettleException e) {
  if (e.getMessage().contains("UnableToSaveStepInfo")) {
    logError("Repository save failed for step id " + id_step + ": " + e.getCause());
    // check DB connectivity/permissions, then retry
  } else throw e;
}

Prevention

When it happens

Trigger: saveRep(rep, metaStore, id_transformation, id_step) throws while calling rep.saveStepAttribute(...) for sequence fields or rep.insertStepDatabase(...) when a database is linked — repository connection loss, constraint violations, read-only repository, or null/oversized attribute values.

Common situations: Repository database down or network dropped mid-save; user lacks INSERT permission on repository tables; referencing a database connection object not yet saved (null/unsaved ObjectId) so insertStepDatabase fails; repository size/quota limits.

Related errors


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

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/addsequence/AddSequenceMeta.java:362

      rep.saveStepAttribute( id_transformation, id_step, "use_database", useDatabase );

      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", database );

      rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
      rep.saveStepAttribute( id_transformation, id_step, "seqname", sequenceName );

      rep.saveStepAttribute( id_transformation, id_step, "use_counter", useCounter );
      rep.saveStepAttribute( id_transformation, id_step, "counter_name", counterName );
      rep.saveStepAttribute( id_transformation, id_step, "start_at", startAt );
      rep.saveStepAttribute( id_transformation, id_step, "increment_by", incrementBy );
      rep.saveStepAttribute( id_transformation, id_step, "max_value", maxValue );

      // Also, save the step-database relationship!
      if ( database != null ) {
        rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "AddSequenceMeta.Exception.UnableToSaveStepInfo" )
        + id_step, e );
    }
  }

  @Override
  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ) {
    CheckResult cr;
    if ( useDatabase ) {
      Database db = new Database( loggingObject, database );
      db.shareVariablesWith( transMeta );
      try {
        db.connect();
        if ( db.checkSequenceExists( transMeta.environmentSubstitute( schemaName ), transMeta
          .environmentSubstitute( sequenceName ) ) ) {
          cr =
            new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(

View on GitHub (pinned to f3058517a1)