pentaho/pentaho-kettle · error · KettleException

SwitchCaseMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

SwitchCaseMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

Error message

SwitchCaseMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository

What it means

KettleException thrown by SwitchCaseMeta.readRep when an unexpected exception occurs while reading the Switch/Case step's configuration from a Pentaho repository — including the fieldname, contains/startswith flags, and per-case attributes (case_value, case_target_step). Any repository failure inside the try block is wrapped with this localized message and rethrown; the root cause is in the chained exception.

Solutions

  1. Inspect the chained cause exception for the underlying repository error.
  2. Verify repository connectivity and re-login, then retry loading the transformation.
  3. Repair the step by re-creating the Switch/Case step and re-entering its mappings, then re-save.
  4. Check for interrupted/partial saves in the repository database and clean up orphaned attribute rows.
Defensive patterns

Strategy: try-catch

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: Loading the transformation from a repository when rep.getStepAttributeString fails (connection loss, corrupt attributes), or the count/structure of stored case entries mismatches what readRep iterates (e.g., missing nr attribute rows from a partial save).

Common situations: Repository database corruption or interrupted save leaving partial r_step_attribute rows; version mismatch between client and repository metadata; permission or network issues during load.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

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

      fieldname = rep.getStepAttributeString( id_step, "fieldname" );
      isContains = rep.getStepAttributeBoolean( id_step, "use_contains" );
      caseValueType = ValueMetaBase.getType( rep.getStepAttributeString( id_step, "case_value_type" ) );
      caseValueFormat = rep.getStepAttributeString( id_step, "case_value_format" );
      caseValueDecimal = rep.getStepAttributeString( id_step, "case_value_decimal" );
      caseValueGroup = rep.getStepAttributeString( id_step, "case_value_group" );

      defaultTargetStepname = rep.getStepAttributeString( id_step, "default_target_step" );

      int nrCases = rep.countNrStepAttributes( id_step, "case_value" );
      allocate();
      for ( int i = 0; i < nrCases; i++ ) {
        SwitchCaseTarget target = new SwitchCaseTarget();
        target.caseValue = rep.getStepAttributeString( id_step, i, "case_value" );
        target.caseTargetStepname = rep.getStepAttributeString( id_step, i, "case_target_step" );
        caseTargets.add( target );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "SwitchCaseMeta.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, "fieldname", fieldname );
      rep.saveStepAttribute( id_transformation, id_step, "use_contains", isContains );
      rep.saveStepAttribute( id_transformation, id_step, "case_value_type", ValueMetaBase.getTypeDesc( caseValueType ) );
      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++ ) {

View on GitHub (pinned to f3058517a1)