pentaho/pentaho-kettle · error · KettleException

TransHopMeta.Exception.LoadTransformationHopInfo

Error message

TransHopMeta.Exception.LoadTransformationHopInfo

What it means

Thrown by loadTransHopMeta() when loading a hop by its repository id fails with a KettleDatabaseException. The hop id is appended to the message. Failures can come from the R_TRANS_HOP query or from resolving the from/to StepMeta objects.

Solutions

  1. Verify the hop's from/to step ids exist in R_STEP and load all steps before hops
  2. Delete orphaned R_TRANS_HOP rows referencing nonexistent steps
  3. Check the chained KettleDatabaseException for the underlying SQL error
  4. Re-save the transformation to rebuild consistent hop/step rows

Example fix

// before
List<StepMeta> steps = new ArrayList<>(); // incomplete
TransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);

// after
List<StepMeta> steps = delegate.loadAllTransSteps(transId, databases, metaStore); // full list
TransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);
Defensive patterns

Strategy: try-catch

Validate before calling

// Java: ensure all steps are loaded before loading hops
if (steps == null || steps.isEmpty()) {
  throw new IllegalStateException("Load transformation steps before loading hops");
}

Try / catch

try {
  TransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);
} catch (KettleException e) {
  log.error("Hop " + hopId + " unreadable: " + e.getCause(), e);
  hop = null; // skip orphaned hop and continue loading
}

Prevention

When it happens

Trigger: Calling loadTransHopMeta(id_trans_hop, steps) when the hop row cannot be read, or when from/to step ids referenced by the hop are not present in the supplied steps list / repository.

Common situations: Hop rows left orphaned after steps were deleted, loading hops with an incomplete steps list, stale ids after repository cleanup, or DB read errors.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java:1165

      if ( hopTransMeta.getToStep() == null && id_step_to > 0 ) {
        // Simply load this, we only want the name, we don't care about
        // the rest...
        StepMeta stepMeta =
          repository.stepDelegate.loadStepMeta(
            new LongObjectId( id_step_to ), new ArrayList<DatabaseMeta>(), new ArrayList<PartitionSchema>() );
        hopTransMeta.setToStep( StepMeta.findStep( steps, stepMeta.getName() ) );
      }

      if ( hopTransMeta.getFromStep() == null ) {
        // This not a valid hop. Skipping it is better than refusing to load the transformation. PDI-5519
        //
        return null;
      }
      hopTransMeta.getToStep().setDraw( true );

      return hopTransMeta;
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException( BaseMessages.getString( PKG, "TransHopMeta.Exception.LoadTransformationHopInfo" )
        + id_trans_hop, dbe );
    }
  }

  public synchronized int getNrTransformations( ObjectId id_directory ) throws KettleException {
    int retval = 0;

    RowMetaAndData par = repository.connectionDelegate.getParameterMetaData( id_directory );
    String sql =
      "SELECT COUNT(*) FROM "
        + quoteTable( KettleDatabaseRepository.TABLE_R_TRANSFORMATION ) + " WHERE "
        + quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_DIRECTORY ) + " = ? ";
    RowMetaAndData r = repository.connectionDelegate.getOneRow( sql, par.getRowMeta(), par.getData() );
    if ( r != null ) {
      retval = (int) r.getInteger( 0, 0L );
    }

    return retval;

View on GitHub (pinned to f3058517a1)