{"record":{"id":"29ea2465f9c07d9f","repo":"pentaho/pentaho-kettle","slug":"setvariable0006","errorCode":"SETVARIABLE0006","errorMessage":"Unable to save step information to the repository for id_step={0}","messagePattern":"Unable to save step information to the repository for id_step=(.+?)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/setvariable/SetVariableMeta.java","lineNumber":291,"sourceCode":"      throw new KettleException( BaseMessages.getString(\n        PKG, \"SetVariableMeta.RuntimeError.UnableToReadRepository.SETVARIABLE0005\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      for ( int i = 0; i < fieldName.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", Utils.isEmpty( fieldName[i] )\n          ? \"\" : fieldName[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"variable_name\", variableName[i] );\n        rep.saveStepAttribute(\n          id_transformation, id_step, i, \"variable_type\", getVariableTypeCode( variableType[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"default_value\", defaultValue[i] );\n      }\n\n      rep.saveStepAttribute( id_transformation, id_step, 0, \"use_formatting\", usingFormatting );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SetVariableMeta.RuntimeError.UnableToSaveRepository.SETVARIABLE0006\", \"\" + id_step ), e );\n    }\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    if ( prev == null || prev.size() == 0 ) {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_WARNING, BaseMessages.getString(\n          PKG, \"SetVariableMeta.CheckResult.NotReceivingFieldsFromPreviousSteps\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"SetVariableMeta.CheckResult.ReceivingFieldsFromPreviousSteps\", \"\" + prev.size() ), stepMeta );","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/setvariable/SetVariableMeta.java#L273-L309","documentation":"SetVariableMeta.saveRep persists per-field attributes (variable_name, variable_type, default_value) and use_formatting to the repository. Any exception during rep.saveStepAttribute is wrapped in a KettleException with SETVARIABLE0006, including the id_step in the message, meaning the step metadata could not be saved.","triggerScenarios":"saveRep is invoked when saving a transformation to a repository and a saveStepAttribute call fails (repository down, transaction rollback, constraint violation, insufficient rights).","commonSituations":"Repository database read-only or out of space; lost DB connection while saving; permission-denied on the repository user; very long values exceeding column sizes.","solutions":["Check repository database availability, permissions and disk space, then re-save","Save the transformation as a local .ktr file as a workaround","Check the wrapped cause exception for the specific JDBC/repository error","Re-login to the repository with a user that has write rights"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check write access before saving\nif (!rep.getSecurityProvider().isReadOnly() == false) { /* deny early */ }","typeGuard":null,"tryCatchPattern":"try { saveRep(rep, metaStore, id_trans, id_step); } catch (KettleException e) { if (e.getMessage().contains(\"SETVARIABLE0006\")) { log(\"Save to repository failed: \", e.getCause()); /* fall back to saving .ktr locally */ } else throw e; }","preventionTips":["Use repository users with write permissions","Check DB disk space and connectivity before large saves","Keep a local file copy as fallback"],"tags":["kettle","pdi","repository","metadata","persistence"],"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"}