{"record":{"id":"8433a219598f74de","repo":"pentaho/pentaho-kettle","slug":"mergejoinmeta-exception-unexpectederrorreadingstepinfo","errorCode":"MergeJoinMeta.Exception.UnexpectedErrorReadingStepInfo","errorMessage":"MergeJoinMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"MergeJoinMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mergejoin/MergeJoinMeta.java","lineNumber":236,"sourceCode":"    try {\n      int nrKeys1 = rep.countNrStepAttributes( id_step, \"keys_1\" );\n      int nrKeys2 = rep.countNrStepAttributes( id_step, \"keys_2\" );\n\n      allocate( nrKeys1, nrKeys2 );\n\n      for ( int i = 0; i < nrKeys1; i++ ) {\n        keyFields1[i] = rep.getStepAttributeString( id_step, i, \"keys_1\" );\n      }\n      for ( int i = 0; i < nrKeys2; i++ ) {\n        keyFields2[i] = rep.getStepAttributeString( id_step, i, \"keys_2\" );\n      }\n\n      List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();\n      infoStreams.get( 0 ).setSubject( rep.getStepAttributeString( id_step, \"step1\" ) );\n      infoStreams.get( 1 ).setSubject( rep.getStepAttributeString( id_step, \"step2\" ) );\n      joinType = rep.getStepAttributeString( id_step, \"join_type\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"MergeJoinMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\n  public void searchInfoAndTargetSteps( List<StepMeta> steps ) {\n    List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();\n    for ( StreamInterface stream : infoStreams ) {\n      stream.setStepMeta( StepMeta.findStep( steps, (String) stream.getSubject() ) );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      for ( int i = 0; i < keyFields1.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"keys_1\", keyFields1[i] );\n      }\n","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mergejoin/MergeJoinMeta.java#L218-L254","documentation":"Thrown by MergeJoinMeta.readRep when loading the Merge Join step definition from the Kettle repository fails with an unexpected Exception. It reads step1, step2 and join_type step attributes for the given id_step and wraps any failure in a KettleException with this message.","triggerScenarios":"Calling readRep (via TransMeta loading from a repository) when the repository query for step attributes of id_step throws — e.g. missing rows in R_STEP_ATTRIBUTE, repository connection failures, or a corrupted step record.","commonSituations":"Loading a transformation from a repository where its step attribute rows were deleted or never saved; database connectivity problems mid-load; repository schema version mismatch.","solutions":["Check the wrapped cause (KettleException.getCause()) for the underlying repository error.","Verify repository connectivity (database up, credentials valid) and retry loading the transformation.","Query R_STEP_ATTRIBUTE for the id_step to confirm step1/step2/join_type rows exist; re-save the step in Spoon to recreate them.","If the repository schema is inconsistent, run the repository upgrade/repair tooling for your Kettle version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the step's attributes exist in the repository before load\n// SELECT COUNT(*) FROM R_STEP_ATTRIBUTE WHERE ID_STEP = ?  -- expect > 0","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta(repository, transName, directory);\n} catch (KettleException e) {\n  log.error(\"Repository read failed for merge join step: \" + e.getCause(), e);\n}","preventionTips":["Check repository DB connectivity before loading transformations in batch jobs.","Avoid deleting R_STEP_ATTRIBUTE rows directly; edit steps via Spoon.","Keep the repository schema upgraded to match your Kettle version.","Back up the repository database regularly."],"tags":["kettle","repository","step-metadata","merge-join"],"backgroundTag":"database-query-failed","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"}