{"record":{"id":"f395672469ebffcf","repo":"pentaho/pentaho-kettle","slug":"analyticquerymeta-exception-unabletosavestepinfotorepository","errorCode":null,"errorMessage":"AnalyticQueryMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"AnalyticQueryMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/analyticquery/AnalyticQueryMeta.java","lineNumber":362,"sourceCode":"        PKG, \"AnalyticQueryMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\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, \"AnalyticQueryMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\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, \"AnalyticQueryMeta.CheckResult.ReceivingInfoOK\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/analyticquery/AnalyticQueryMeta.java#L344-L380","documentation":"KettleException thrown by AnalyticQueryMeta.saveRep() when persisting the step's aggregate attributes to the repository fails. The message concatenates the step's id_step so you can locate the exact row; the root cause is the wrapped exception. Note the message is the raw key + id_step (no i18n interpolation), which is a known quirk of this call site.","triggerScenarios":"saveRep() -> rep.saveStepAttribute(...) throws for any aggregate loop iteration: repository write failure, connection loss, constraint violations, or read-only repository while saving a transformation.","commonSituations":"Repository database read-only or out of space; broken connection during a long save; insufficient permissions to write KETTLE_STEP_ATTRIBUTE rows; transaction lock/timeout from a concurrent save of the same transformation.","solutions":["Read the wrapped cause to see the repository-side failure and check database logs for the failing insert on id_step","Verify the repository connection is writable and the user has INSERT/UPDATE rights on step attribute tables","Reconnect and retry the save (transient connection drops resolve after reconnect)","Commit or abort stale transactions/locks on the repository tables, then re-save"],"exampleFix":"// after catching it, inspect the cause\ntry { meta.saveRep(rep, metaStore, transId, stepId); }\ncatch (KettleException e) { throw new KettleException(\"save failed for step \" + e.getMessage(), e.getCause()); }","handlingStrategy":"retry","validationCode":"// Verify repository is writable before saving\nif (!rep.isConnected()) throw new IllegalStateException(\"Repository not connected\");\n// Confirm write privileges early with a cheap write/read round-trip or permission check","typeGuard":null,"tryCatchPattern":"try {\n  meta.saveRep(rep, metaStore, idTransformation, idStep);\n} catch (KettleException e) {\n  if (isTransient(e.getCause())) { retrySaveWithBackoff(); }\n  else { log.error(\"Repository save failed for id_step=\" + idStep, e.getCause()); throw e; }\n}","preventionTips":["Ensure the repository DB user has INSERT/UPDATE on step attribute tables","Avoid concurrent edits/saves of the same transformation","Watch for read-only or out-of-space repository databases","Check the wrapped cause immediately — this error is always a wrapper"],"tags":["repository","database-write","serialization","kettle"],"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"}