{"record":{"id":"8ef4fbd5978c874e","repo":"pentaho/pentaho-kettle","slug":"injectormeta-exception-unabletosavestepinfotorepository","errorCode":null,"errorMessage":"InjectorMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"InjectorMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/injector/InjectorMeta.java","lineNumber":210,"sourceCode":"      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"InjectorMeta.Exception.ErrorReadingStepInfoFromRepository\" ), e );\n    }\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\", fieldname[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_type\",\n          ValueMetaFactory.getValueMetaName( type[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_length\", length[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_precision\", precision[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"InjectorMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    for ( int i = 0; i < this.fieldname.length; i++ ) {\n      ValueMetaInterface v;\n      try {\n        v = ValueMetaFactory.createValueMeta( this.fieldname[i], type[i], length[i], precision[i] );\n        inputRowMeta.addValueMeta( v );\n      } catch ( KettlePluginException e ) {\n        throw new KettleStepException( e );\n      }\n    }\n  }","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/injector/InjectorMeta.java#L192-L228","documentation":"InjectorMeta.saveRep() writes the injector step's field array (name, type, length, precision) as numbered step attributes and wraps any exception in a KettleException with this localized message plus the id_step. The field definitions were not saved, so the injector would run with a stale or empty field layout after reload.","triggerScenarios":"saveRep while saving the transformation and any rep.saveStepAttribute(...) throws — repository write failure, connection loss, or invalid id_step value.","commonSituations":"Repository connection dropped mid-save; DB repository read-only or full; saving with an id_step that no longer exists (transformation deleted concurrently); permissions changed for the repository user.","solutions":["Read getCause() to identify and fix the repository-level failure","Reconnect to the repository and retry the save","Confirm the transformation/step still exists and the user has write permission","Save a fresh copy of the transformation if the original record is inconsistent"],"exampleFix":"// before\ntransMeta.saveRep(repo, metaStore, transId, true);\n// after\ntry {\n  transMeta.saveRep(repo, metaStore, transId, true);\n} catch (KettleException e) {\n  logger.error(\"Injector save failed for id_step=\" + e.getCause(), e);\n  repo.disconnect(); repo.connect(user, pass);\n  transMeta.saveRep(repo, metaStore, transId, true);\n}","handlingStrategy":"retry","validationCode":"if (!repo.isConnected()) { repo.connect(user, pass); }","typeGuard":"boolean canSave(Repository repo) { return repo != null && repo.isConnected(); }","tryCatchPattern":"try { transMeta.saveRep(repo, metaStore, transId, true); } catch (KettleException e) { logger.error(\"Save failed: \" + e.getCause(), e); throw e; }","preventionTips":["Inspect getCause() for the underlying repository failure","Avoid concurrent edits of the same transformation","Retry the save after reconnecting the repository"],"tags":["kettle","repository","persistence","injector"],"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"}