{"record":{"id":"c6444c1bd7f5cb8b","repo":"pentaho/pentaho-kettle","slug":"mergerowsmeta-exception-unexpectederrorreadingstepinfo","errorCode":"MergeRowsMeta.Exception.UnexpectedErrorReadingStepInfo","errorMessage":"MergeRowsMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"MergeRowsMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mergerows/MergeRowsMeta.java","lineNumber":233,"sourceCode":"      allocate( nrKeys, nrValues );\n\n      for ( int i = 0; i < nrKeys; i++ ) {\n        keyFields[i] = rep.getStepAttributeString( id_step, i, \"key_field\" );\n      }\n      for ( int i = 0; i < nrValues; i++ ) {\n        valueFields[i] = rep.getStepAttributeString( id_step, i, \"value_field\" );\n      }\n\n      flagField = rep.getStepAttributeString( id_step, \"flag_field\" );\n\n      List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();\n      StreamInterface referenceStream = infoStreams.get( 0 );\n      StreamInterface compareStream = infoStreams.get( 1 );\n\n      referenceStream.setSubject( rep.getStepAttributeString( id_step, \"reference\" ) );\n      compareStream.setSubject( rep.getStepAttributeString( id_step, \"compare\" ) );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"MergeRowsMeta.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  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      for ( int i = 0; i < keyFields.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"key_field\", keyFields[i] );\n      }","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mergerows/MergeRowsMeta.java#L215-L251","documentation":"Thrown by MergeRowsMeta.readRep when loading the Merge Rows step from the Kettle repository fails with an unexpected Exception while reading the 'reference' and 'compare' step attributes for id_step. The failure is wrapped in a KettleException with this message.","triggerScenarios":"Loading a transformation from a repository when rep.getStepAttributeString for id_step throws — missing attribute rows, repository connection errors, or a corrupted step record in R_STEP_ATTRIBUTE.","commonSituations":"Repository database unreachable during load; attribute rows deleted or never saved; repository schema mismatch between Kettle versions.","solutions":["Check KettleException.getCause() for the underlying repository/database error.","Verify repository connectivity and credentials, then retry loading.","Confirm reference/compare attribute rows exist for id_step; re-save the step in Spoon to recreate them.","Repair or upgrade the repository schema if it is inconsistent with your Kettle version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the step record exists in the repository before load\n// SELECT COUNT(*) FROM R_STEP WHERE ID_STEP = ?  -- expect 1","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta(repository, transName, directory);\n} catch (KettleException e) {\n  log.error(\"Repository read failed for merge rows step: \" + e.getCause(), e);\n}","preventionTips":["Test repository connectivity before bulk loading transformations.","Do not manipulate repository tables directly; use Spoon.","Keep the repository schema version aligned with the engine.","Schedule loads with retry logic to survive transient DB outages."],"tags":["kettle","repository","step-metadata","merge-rows"],"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"}