{"record":{"id":"2de264a280a96499","repo":"pentaho/pentaho-kettle","slug":"memorygroupbymeta-exception","errorCode":"MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository","errorMessage":"MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository","messagePattern":"MemoryGroupByMeta\\.Exception\\.UnexpectedErrorInReadingStepInfoFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByMeta.java","lineNumber":491,"sourceCode":"        groupField[i] = rep.getStepAttributeString( id_step, i, \"group_name\" );\n      }\n\n      boolean hasNumberOfValues = false;\n      for ( int i = 0; i < nrvalues; i++ ) {\n        aggregateField[i] = rep.getStepAttributeString( id_step, i, \"aggregate_name\" );\n        subjectField[i] = rep.getStepAttributeString( id_step, i, \"aggregate_subject\" );\n        aggregateType[i] = getType( rep.getStepAttributeString( id_step, i, \"aggregate_type\" ) );\n\n        if ( aggregateType[i] == TYPE_GROUP_COUNT_ALL\n          || aggregateType[i] == TYPE_GROUP_COUNT_DISTINCT || aggregateType[i] == TYPE_GROUP_COUNT_ANY ) {\n          hasNumberOfValues = true;\n        }\n        valueField[i] = rep.getStepAttributeString( id_step, i, \"aggregate_value_field\" );\n      }\n\n      alwaysGivingBackOneRow = rep.getStepAttributeBoolean( id_step, 0, \"give_back_row\", hasNumberOfValues );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"MemoryGroupByMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository\" ), e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"give_back_row\", alwaysGivingBackOneRow );\n\n      for ( int i = 0; i < groupField.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"group_name\", groupField[i] );\n      }\n\n      for ( int i = 0; i < subjectField.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_name\", aggregateField[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_subject\", subjectField[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_type\", getTypeDesc( aggregateType[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"aggregate_value_field\", valueField[i] );","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByMeta.java#L473-L509","documentation":"MemoryGroupByMeta.readRep() loads the step's configuration from repository attributes (group fields, aggregate fields, types, value fields, give_back_row). Any exception during these repository reads is wrapped in a KettleException with this message key, indicating the stored step metadata could not be read. The underlying repository/database error is preserved as the cause.","triggerScenarios":"Calling readRep() when Repository.getStepAttributeString/Boolean/Integer throws — lost repository connection, id_step referencing a nonexistent or partially deleted step, or attribute values that fail type conversion (e.g. non-numeric stored where an int is expected).","commonSituations":"Repository database restarted or network blip during transformation load; steps deleted directly in the DB; corrupted R_STEP_ATTRIBUTE rows from a failed save; loading transformations saved by an incompatible plugin version.","solutions":["Verify repository connectivity and reconnect, then retry loading the transformation.","Examine the cause exception for the database-level error and address it (missing rows, bad data, permissions).","Confirm the step's rows in R_STEP_ATTRIBUTE exist and are consistent; re-create the step in Spoon and re-save if corrupt.","If the transformation came from a different Pentaho/plugin version, migrate it and re-save before loading in production."],"exampleFix":"// before\nmeta.readRep(repository, metastore, transObjectId, stepObjectId);\n\n// after: guard against stale connections and log the root cause\ntry {\n  meta.readRep(repository, metastore, transObjectId, stepObjectId);\n} catch (KettleException e) {\n  logError(\"Reading MemoryGroupBy metadata failed: \" + e.getCause(), e);\n  repository.disconnect();\n  repository.connect(user, password);\n  meta.readRep(repository, metastore, transObjectId, stepObjectId);\n}","handlingStrategy":"try-catch","validationCode":"if (repository == null || !repository.isConnected()) {\n  repository.connect(user, password);\n}\n// verify the step metadata rows exist\nif (!repository.stepExists(stepName)) {\n  throw new IllegalStateException(\"Step not found in repository: \" + stepName);\n}","typeGuard":"boolean canReadStep(Repository rep, ObjectId idStep) {\n  return rep != null && rep.isConnected() && idStep != null && !idStep.isEmpty();\n}","tryCatchPattern":"try {\n  meta.readRep(repository, metastore, transObjectId, stepObjectId);\n} catch (KettleException e) {\n  logError(\"MemoryGroupBy repository read failed: \" + e.getCause(), e);\n  throw e;\n}","preventionTips":["Maintain stable repository connections; reconnect after DB maintenance.","Check chained cause immediately to identify the underlying database fault.","Avoid concurrent edits of the same transformation by multiple users.","Re-save steps after Pentaho/plugin upgrades to refresh attribute layout."],"tags":["kettle","repository","step-metadata","memory-groupby"],"backgroundTag":"file-read-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"}