{"record":{"id":"87fcc6190ef58fa4","repo":"pentaho/pentaho-kettle","slug":"groupbymeta-exception-unabletosavestepinfotorepository","errorCode":"GroupByMeta.Exception.UnableToSaveStepInfoToRepository","errorMessage":"GroupByMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"GroupByMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/groupby/GroupByMeta.java","lineNumber":669,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, \"field_ignore\", aggregateIgnoredField );\n      rep.saveStepAttribute( id_transformation, id_step, \"directory\", directory );\n      rep.saveStepAttribute( id_transformation, id_step, \"prefix\", prefix );\n      rep.saveStepAttribute( id_transformation, id_step, \"add_linenr\", addingLineNrInGroup );\n      rep.saveStepAttribute( id_transformation, id_step, \"linenr_fieldname\", lineNrInGroupField );\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 ] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GroupByMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,\n                     RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,\n                     Repository repository, IMetaStore metaStore ) {\n    CheckResult cr;\n\n    if ( input.length > 0 ) {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"GroupByMeta.CheckResult.ReceivingInfoOK\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/groupby/GroupByMeta.java#L651-L687","documentation":"Despite the method label, this throw sits in saveRep (repository save path): GroupByMeta wraps failures while persisting the step's attributes into the Pentaho repository in this KettleException. Saving the GroupBy step definition failed.","triggerScenarios":"saveRep calls rep.saveStepAttribute(...) for fields like group_field, aggregate_name, aggregate_type; the repository is read-only, the connection drops, or a constraint fails, throwing an exception that is wrapped with id_step appended.","commonSituations":"Repository database down or network blip mid-save; read-only or locked repository user; transaction rollback from a DB constraint; saving to a repository in maintenance mode.","solutions":["Check repository DB connectivity and re-save the transformation","Verify the repository user has write privileges","Inspect the wrapped cause for the SQL/database error","Save the transformation as a local .ktr file as a workaround, then retry the repository save","Run repository integrity/upgrade scripts if the schema is outdated"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check write access before saveRep\nif ( repository.isReadOnly() != null && repository.isReadOnly() ) {\n  throw new IllegalStateException( \"Repository is read-only\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  repository.save( transMeta, \"initial version\", null, true );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"UnableToSaveStepInfoToRepository\" ) ) {\n    log.error( \"GroupBy save failed; inspect cause for SQL error, retry or save locally\", e.getCause() );\n    transMeta.saveToFile( File.createTempFile( \"fallback\", \".ktr\" ), \"utf-8\" );\n  } else { throw e; }\n}","preventionTips":["Grant the repository user write privileges on transformation tables","Check DB connectivity and space before bulk saves","Save a local .ktr backup before repository operations","Watch for repository maintenance/read-only windows"],"tags":["kettle","pdi","repository","metadata","save"],"backgroundTag":"database-write-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"}