{"record":{"id":"5efdd33259dfb4e8","repo":"pentaho/pentaho-kettle","slug":"groupbymeta-exception-unabletoloadstepinfofromxml","errorCode":"GroupByMeta.Exception.UnableToLoadStepInfoFromXML","errorMessage":"GroupByMeta.Exception.UnableToLoadStepInfoFromXML","messagePattern":"GroupByMeta\\.Exception\\.UnableToLoadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/groupby/GroupByMeta.java","lineNumber":398,"sourceCode":"        subjectField[ i ] = XMLHandler.getTagValue( fnode, \"subject\" );\n        aggregateType[ i ] = getType( XMLHandler.getTagValue( fnode, \"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\n        valueField[ i ] = XMLHandler.getTagValue( fnode, \"valuefield\" );\n      }\n\n      String giveBackRow = XMLHandler.getTagValue( stepnode, \"give_back_row\" );\n      if ( Utils.isEmpty( giveBackRow ) ) {\n        alwaysGivingBackOneRow = hasNumberOfValues;\n      } else {\n        alwaysGivingBackOneRow = \"Y\".equalsIgnoreCase( giveBackRow );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"GroupByMeta.Exception.UnableToLoadStepInfoFromXML\" ), e );\n    }\n  }\n\n  public static final int getType( String desc ) {\n    for ( int i = 0; i < typeGroupCode.length; i++ ) {\n      if ( typeGroupCode[ i ].equalsIgnoreCase( desc ) ) {\n        return i;\n      }\n    }\n    for ( int i = 0; i < typeGroupLongDesc.length; i++ ) {\n      if ( typeGroupLongDesc[ i ].equalsIgnoreCase( desc ) ) {\n        return i;\n      }\n    }\n    return 0;\n  }\n","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/groupby/GroupByMeta.java#L380-L416","documentation":"GroupByMeta.loadXML wraps any exception thrown while parsing the step's XML (via readData) in this KettleXMLException. It means the <step> XML fragment for a GroupBy step is malformed or missing expected nodes, so the step metadata could not be reconstructed.","triggerScenarios":"loadXML calls readData on a transformation .ktr; getElementByTag returns bad values or Integer.parseInt/field parsing fails on attributes like group/aggregate fields, directory, prefix, or give_back_row.","commonSituations":"Hand-edited or truncated .ktr files; transformations exported from a newer/older Pentaho version with different XML schema; copy-paste between transformations losing child nodes; corrupt repository export.","solutions":["Open the .ktr in Spoon and fix or recreate the GroupBy step's XML section","Validate the XML contains all expected tags (group, aggregates, directory, prefix, give_back_row)","Compare against a working GroupBy step definition and restore missing nodes","Check the wrapped cause 'e' in the log to find the exact failing parse line","Re-export or regenerate the transformation rather than hand-editing"],"exampleFix":"// before (truncated XML)\n<fields><field><name>grp</name></fields>\n// after\n<fields>\n  <field><name>grp</name><aggregate>grp</aggregate><type>GroupConcat</type></field>\n</fields>","handlingStrategy":"validation","validationCode":"// validate the GroupBy XML section before loadXML\nDocument doc = Xml.load( ktrFile );\nNode step = XPath.selectNode( doc, \"//step[type='GroupBy']\" );\nfor ( String tag : new String[] { \"group\", \"fields\", \"directory\", \"prefix\", \"give_back_row\" } ) {\n  if ( XPath.selectSingleNode( step, tag ) == null ) {\n    throw new IllegalArgumentException( \"GroupBy step missing <\" + tag + \"> node\" );\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.loadXML( file, null, false, null, null, true );\n} catch ( KettleXMLException e ) {\n  if ( e.getMessage().contains( \"UnableToLoadStepInfoFromXML\" ) ) {\n    log.error( \"GroupBy step XML invalid: {}\", file, e.getCause() );\n  } else { throw e; }\n}","preventionTips":["Never hand-edit .ktr files; edit in Spoon","Keep export/import Pentaho versions consistent","Validate .ktr XML against the schema after external edits","Back up transformations before bulk edits"],"tags":["kettle","pdi","xml","metadata","groupby"],"backgroundTag":"schema-validation-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"}