pentaho/pentaho-kettle · error · KettleException

SETVARIABLE0005

SETVARIABLE0005

Error message

Unexpected error reading step information from the repository

What it means

SetVariableMeta.readRep loads the step's configuration from the repository (per-field variable_name, variable_type, default_value rows plus use_formatting). Any exception during these repository reads is wrapped in a KettleException with SETVARIABLE0005, indicating repository step metadata could not be read.

Solutions

  1. Verify repository connectivity and retry loading the transformation
  2. Repair the repository (r_step_attribute rows for this id_step) or re-save the step
  3. Upgrade/align the repository schema with the current PDI version (repository upgrade scripts)
  4. Inspect the wrapped cause in the stack trace for the underlying repository exception
Defensive patterns

Strategy: try-catch

Validate before calling

// verify repository connectivity before load
if (!rep.connect(null, false)) throw new IllegalStateException("repository unreachable");

Try / catch

try { loadRep(rep, metaStore, id_step); } catch (KettleException e) { if (e.getMessage().contains("SETVARIABLE0005")) { log("Repository read failed: ", e.getCause()); /* retry or load from XML fallback */ } else throw e; }

Prevention

When it happens

Trigger: loadRep calls readRep for the step and rep.getStepAttributeString/Boolean throws or the surrounding block fails (e.g. repository connection issue, corrupt r_step_attribute rows, wrong id_step).

Common situations: Repository database partially migrated (missing attribute rows); stale id_step after a repository upgrade; network/DB outage mid-load; shared repository accessed with an older PDI client.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/setvariable/SetVariableMeta.java:273

    return retval.toString();
  }

  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {
    try {
      int nrfields = rep.countNrStepAttributes( id_step, "field_name" );

      allocate( nrfields );

      for ( int i = 0; i < nrfields; i++ ) {
        fieldName[i] = rep.getStepAttributeString( id_step, i, "field_name" );
        variableName[i] = rep.getStepAttributeString( id_step, i, "variable_name" );
        variableType[i] = getVariableType( rep.getStepAttributeString( id_step, i, "variable_type" ) );
        defaultValue[i] = rep.getStepAttributeString( id_step, i, "default_value" );
      }

      usingFormatting = rep.getStepAttributeBoolean( id_step, 0, "use_formatting", false );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "SetVariableMeta.RuntimeError.UnableToReadRepository.SETVARIABLE0005" ), 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", Utils.isEmpty( fieldName[i] )
          ? "" : fieldName[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "variable_name", variableName[i] );
        rep.saveStepAttribute(
          id_transformation, id_step, i, "variable_type", getVariableTypeCode( variableType[i] ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "default_value", defaultValue[i] );
      }

      rep.saveStepAttribute( id_transformation, id_step, 0, "use_formatting", usingFormatting );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(

View on GitHub (pinned to f3058517a1)