{"record":{"id":"4d96a9c1b24d254d","repo":"pentaho/pentaho-kettle","slug":"transhopmeta-exception-loadtransformationhopinfo","errorCode":null,"errorMessage":"TransHopMeta.Exception.LoadTransformationHopInfo","messagePattern":"TransHopMeta\\.Exception\\.LoadTransformationHopInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java","lineNumber":1165,"sourceCode":"      if ( hopTransMeta.getToStep() == null && id_step_to > 0 ) {\n        // Simply load this, we only want the name, we don't care about\n        // the rest...\n        StepMeta stepMeta =\n          repository.stepDelegate.loadStepMeta(\n            new LongObjectId( id_step_to ), new ArrayList<DatabaseMeta>(), new ArrayList<PartitionSchema>() );\n        hopTransMeta.setToStep( StepMeta.findStep( steps, stepMeta.getName() ) );\n      }\n\n      if ( hopTransMeta.getFromStep() == null ) {\n        // This not a valid hop. Skipping it is better than refusing to load the transformation. PDI-5519\n        //\n        return null;\n      }\n      hopTransMeta.getToStep().setDraw( true );\n\n      return hopTransMeta;\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"TransHopMeta.Exception.LoadTransformationHopInfo\" )\n        + id_trans_hop, dbe );\n    }\n  }\n\n  public synchronized int getNrTransformations( ObjectId id_directory ) throws KettleException {\n    int retval = 0;\n\n    RowMetaAndData par = repository.connectionDelegate.getParameterMetaData( id_directory );\n    String sql =\n      \"SELECT COUNT(*) FROM \"\n        + quoteTable( KettleDatabaseRepository.TABLE_R_TRANSFORMATION ) + \" WHERE \"\n        + quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_DIRECTORY ) + \" = ? \";\n    RowMetaAndData r = repository.connectionDelegate.getOneRow( sql, par.getRowMeta(), par.getData() );\n    if ( r != null ) {\n      retval = (int) r.getInteger( 0, 0L );\n    }\n\n    return retval;","sourceCodeStart":1147,"sourceCodeEnd":1183,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java#L1147-L1183","documentation":"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.","triggerScenarios":"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.","commonSituations":"Hop rows left orphaned after steps were deleted, loading hops with an incomplete steps list, stale ids after repository cleanup, or DB read errors.","solutions":["Verify the hop's from/to step ids exist in R_STEP and load all steps before hops","Delete orphaned R_TRANS_HOP rows referencing nonexistent steps","Check the chained KettleDatabaseException for the underlying SQL error","Re-save the transformation to rebuild consistent hop/step rows"],"exampleFix":"// before\nList<StepMeta> steps = new ArrayList<>(); // incomplete\nTransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);\n\n// after\nList<StepMeta> steps = delegate.loadAllTransSteps(transId, databases, metaStore); // full list\nTransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);","handlingStrategy":"try-catch","validationCode":"// Java: ensure all steps are loaded before loading hops\nif (steps == null || steps.isEmpty()) {\n  throw new IllegalStateException(\"Load transformation steps before loading hops\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  TransHopMeta hop = delegate.loadTransHopMeta(hopId, steps);\n} catch (KettleException e) {\n  log.error(\"Hop \" + hopId + \" unreadable: \" + e.getCause(), e);\n  hop = null; // skip orphaned hop and continue loading\n}","preventionTips":["Load steps fully before resolving hops","Clean orphaned rows in R_TRANS_HOP during repository maintenance","Reload ids after any repository cleanup or migration","Validate the cause chain to separate missing rows from DB failures"],"tags":["database","repository","kettle","hop"],"backgroundTag":"record-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}