pentaho/pentaho-kettle · error · KettleException

SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository

SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository

Error message

SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository + id_step

What it means

KettleException thrown by SwitchCaseMeta.saveRep when saving the Switch/Case step's configuration to a Pentaho repository fails. saveRep writes the switch field name and each case target (case_value, case_target_step) via rep.saveStepAttribute; any exception in that block is wrapped with this localized message plus the step id and rethrown.

Solutions

  1. Check the chained cause exception to identify the underlying repository/database failure.
  2. Confirm the repository user has write permission on the target transformation folder.
  3. Restore connectivity and retry the save.
  4. Reduce/normalize case-value content if repository column limits are being exceeded.
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure write access before saving
if ( !repository.isConnected() ) throw new IllegalStateException( "Repository not connected" );

Try / catch

try { meta.saveRep( rep, metaStore, idTrans, idStep ); } catch ( KettleException e ) { log.error( "Switch/Case saveRep failed for " + idStep + ": " + e.getCause(), e ); throw e; }

Prevention

When it happens

Trigger: Saving the transformation when the repository write fails: connection loss mid-save, database constraint/size limits on attribute strings, insufficient write permissions, or a very large number of case values overflowing the attribute numbering.

Common situations: Read-only repository or missing edit rights on the transformation folder; DB connectivity drops during save; long case values or step names exceeding repository column sizes; concurrent saves from multiple designers.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/switchcase/SwitchCaseMeta.java:235

      rep.saveStepAttribute( id_transformation, id_step, "case_value_format", caseValueFormat );
      rep.saveStepAttribute( id_transformation, id_step, "case_value_decimal", caseValueDecimal );
      rep.saveStepAttribute( id_transformation, id_step, "case_value_group", caseValueGroup );

      rep.saveStepAttribute( id_transformation, id_step, "default_target_step",
        defaultTargetStep != null ? defaultTargetStep.getName() : defaultTargetStepname
      );

      for ( int i = 0; i < caseTargets.size(); i++ ) {
        SwitchCaseTarget target = caseTargets.get( i );
        rep.saveStepAttribute( id_transformation, id_step, i, "case_value",
          target.caseValue != null ? target.caseValue : ""
        );
        rep.saveStepAttribute( id_transformation, id_step, i, "case_target_step",
          target.caseTargetStep != null ? target.caseTargetStep.getName() : target.caseTargetStepname
        );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
    }
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    // Default: nothing changes to rowMeta
  }

  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;

    StepIOMetaInterface ioMeta = getStepIOMeta();
    List<StreamInterface> targetStreams = ioMeta.getTargetStreams();

View on GitHub (pinned to f3058517a1)