{"record":{"id":"111994d964f321e0","repo":"pentaho/pentaho-kettle","slug":"switchcasemeta-exception-unabletosavestepinfotorepository","errorCode":"SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository","errorMessage":"SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository + id_step","messagePattern":"SwitchCaseMeta\\.Exception\\.UnableToSaveStepInfoToRepository \\+ id_step","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/switchcase/SwitchCaseMeta.java","lineNumber":235,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, \"case_value_format\", caseValueFormat );\n      rep.saveStepAttribute( id_transformation, id_step, \"case_value_decimal\", caseValueDecimal );\n      rep.saveStepAttribute( id_transformation, id_step, \"case_value_group\", caseValueGroup );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"default_target_step\",\n        defaultTargetStep != null ? defaultTargetStep.getName() : defaultTargetStepname\n      );\n\n      for ( int i = 0; i < caseTargets.size(); i++ ) {\n        SwitchCaseTarget target = caseTargets.get( i );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"case_value\",\n          target.caseValue != null ? target.caseValue : \"\"\n        );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"case_target_step\",\n          target.caseTargetStep != null ? target.caseTargetStep.getName() : target.caseTargetStepname\n        );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SwitchCaseMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    // Default: nothing changes to rowMeta\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    StepIOMetaInterface ioMeta = getStepIOMeta();\n    List<StreamInterface> targetStreams = ioMeta.getTargetStreams();","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/switchcase/SwitchCaseMeta.java#L217-L253","documentation":"KettleException thrown by SwitchCaseMeta.saveRep when saving the Switch/Case step's configuration to a Pentaho repository fails. saveRep writes the switch field name and each case target (case_value, case_target_step) via rep.saveStepAttribute; any exception in that block is wrapped with this localized message plus the step id and rethrown.","triggerScenarios":"Saving the transformation when the repository write fails: connection loss mid-save, database constraint/size limits on attribute strings, insufficient write permissions, or a very large number of case values overflowing the attribute numbering.","commonSituations":"Read-only repository or missing edit rights on the transformation folder; DB connectivity drops during save; long case values or step names exceeding repository column sizes; concurrent saves from multiple designers.","solutions":["Check the chained cause exception to identify the underlying repository/database failure.","Confirm the repository user has write permission on the target transformation folder.","Restore connectivity and retry the save.","Reduce/normalize case-value content if repository column limits are being exceeded."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure write access before saving\nif ( !repository.isConnected() ) throw new IllegalStateException( \"Repository not connected\" );","typeGuard":null,"tryCatchPattern":"try { meta.saveRep( rep, metaStore, idTrans, idStep ); } catch ( KettleException e ) { log.error( \"Switch/Case saveRep failed for \" + idStep + \": \" + e.getCause(), e ); throw e; }","preventionTips":["Save with modify permissions.","Avoid very long case values/step names near column limits.","Retry on transient DB errors.","Avoid concurrent edits to the same transformation."],"tags":["kettle","repository","metadata-save","pdi"],"backgroundTag":"file-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"}