pentaho/pentaho-kettle · error · KettleException

InjectorMeta.Exception.UnableToSaveStepInfoToRepository

Error message

InjectorMeta.Exception.UnableToSaveStepInfoToRepository

What it means

InjectorMeta.saveRep() writes the injector step's field array (name, type, length, precision) as numbered step attributes and wraps any exception in a KettleException with this localized message plus the id_step. The field definitions were not saved, so the injector would run with a stale or empty field layout after reload.

Solutions

  1. Read getCause() to identify and fix the repository-level failure
  2. Reconnect to the repository and retry the save
  3. Confirm the transformation/step still exists and the user has write permission
  4. Save a fresh copy of the transformation if the original record is inconsistent

Example fix

// before
transMeta.saveRep(repo, metaStore, transId, true);
// after
try {
  transMeta.saveRep(repo, metaStore, transId, true);
} catch (KettleException e) {
  logger.error("Injector save failed for id_step=" + e.getCause(), e);
  repo.disconnect(); repo.connect(user, pass);
  transMeta.saveRep(repo, metaStore, transId, true);
}
Defensive patterns

Strategy: retry

Validate before calling

if (!repo.isConnected()) { repo.connect(user, pass); }

Type guard

boolean canSave(Repository repo) { return repo != null && repo.isConnected(); }

Try / catch

try { transMeta.saveRep(repo, metaStore, transId, true); } catch (KettleException e) { logger.error("Save failed: " + e.getCause(), e); throw e; }

Prevention

When it happens

Trigger: saveRep while saving the transformation and any rep.saveStepAttribute(...) throws — repository write failure, connection loss, or invalid id_step value.

Common situations: Repository connection dropped mid-save; DB repository read-only or full; saving with an id_step that no longer exists (transformation deleted concurrently); permissions changed for the repository user.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/injector/InjectorMeta.java:210

      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "InjectorMeta.Exception.ErrorReadingStepInfoFromRepository" ), e );
    }

  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      for ( int i = 0; i < fieldname.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldname[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_type",
          ValueMetaFactory.getValueMetaName( type[i] ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_length", length[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", precision[i] );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "InjectorMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
    }
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    for ( int i = 0; i < this.fieldname.length; i++ ) {
      ValueMetaInterface v;
      try {
        v = ValueMetaFactory.createValueMeta( this.fieldname[i], type[i], length[i], precision[i] );
        inputRowMeta.addValueMeta( v );
      } catch ( KettlePluginException e ) {
        throw new KettleStepException( e );
      }
    }
  }

View on GitHub (pinned to f3058517a1)