pentaho/pentaho-kettle · error · KettleException

FlattenerMeta.Exception.UnableToSaveStepInfoToRepository

FlattenerMeta.Exception.UnableToSaveStepInfoToRepository

Error message

FlattenerMeta.Exception.UnableToSaveStepInfoToRepository

What it means

KettleException thrown by FlattenerMeta.saveRep() when saving the step's attributes (field_name, target_field rows) to a Pentaho repository fails. It wraps the underlying repository exception and appends the step id. It occurs only during 'save to repository' operations, not during transformation execution.

Solutions

  1. Check the repository connection (test login, ping the repository database) and retry the save.
  2. Inspect the wrapped cause ('Caused by') for the true repository/SQL error and fix it.
  3. Save locally as a .ktr file to confirm the step metadata itself is valid, then fix the repository issue.
  4. Verify the repository schema is up to date and the user has write permissions.

Example fix

// before
transMeta.save(rep, "my transform", null, true);
// after
if (rep != null && rep.isConnected()) {
  transMeta.save(rep, "my transform", null, true);
} else {
  transMeta.exportElements(null, new File("local-fallback.ktr"));
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (rep == null || !rep.isConnected()) { throw new IllegalStateException("Repository not connected"); }

Try / catch

try { transMeta.save(rep, name, null, true); } catch (KettleException e) { log.error("Repo save failed: " + e.getCause(), e); transMeta.exportElements(null, new File("local.ktr")); }

Prevention

When it happens

Trigger: Calling saveRep() on a Flattener step meta while the repository connection is broken, read-only, or the underlying rep.saveStepAttribute() calls throw (e.g. network drop to the database-backed repository, missing repository tables).

Common situations: Saving a transformation to a shared enterprise repository over an unreliable VPN; repository schema version mismatch; DB credentials expired mid-save; concurrent lock on the transformation record.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/flattener/FlattenerMeta.java:188

      for ( int i = 0; i < nrvalues; i++ ) {
        targetField[i] = rep.getStepAttributeString( id_step, i, "target_field" );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "FlattenerMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository" ), e );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      rep.saveStepAttribute( id_transformation, id_step, "field_name", fieldName );

      for ( int i = 0; i < targetField.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "target_field", targetField[i] );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "FlattenerMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
    }
  }

  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 ( input.length > 0 ) {
      cr =
        new CheckResult( CheckResult.TYPE_RESULT_OK, BaseMessages.getString(
          PKG, "FlattenerMeta.CheckResult.StepReceivingInfoFromOtherSteps" ), stepMeta );
      remarks.add( cr );
    } else {
      cr =

View on GitHub (pinned to f3058517a1)