{"record":{"id":"a58182059e215944","repo":"pentaho/pentaho-kettle","slug":"getpreviousrowfieldmeta-exception-unabletosavestepinfo","errorCode":null,"errorMessage":"GetPreviousRowFieldMeta.Exception.UnableToSaveStepInfo","messagePattern":"GetPreviousRowFieldMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/get-previous-row-field/core/src/main/java/org/pentaho/di/trans/steps/getpreviousrowfield/GetPreviousRowFieldMeta.java","lineNumber":211,"sourceCode":"        fieldOutStream[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"out_stream_name\" ), \"\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GetPreviousRowFieldMeta.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"schema\", schema );\n\n      for ( int i = 0; i < fieldInStream.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"in_stream_name\", fieldInStream[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"out_stream_name\", fieldOutStream[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GetPreviousRowFieldMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info,\n    StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n\n    // Add new field?\n    for ( int i = 0; i < fieldOutStream.length; i++ ) {\n      if ( !Utils.isEmpty( fieldOutStream[i] ) ) {\n        int index = inputRowMeta.indexOfValue( fieldInStream[i] );\n        if ( index >= 0 ) {\n          ValueMetaInterface in = inputRowMeta.getValueMeta( index );\n          try {\n            ValueMetaInterface v =\n              ValueMetaFactory.createValueMeta( space.environmentSubstitute( fieldOutStream[i] ), in.getType() );","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/get-previous-row-field/core/src/main/java/org/pentaho/di/trans/steps/getpreviousrowfield/GetPreviousRowFieldMeta.java#L193-L229","documentation":"GetPreviousRowFieldMeta.saveRep() writes each field's in_stream_name/out_stream_name as numbered step attributes. Any exception from the repository during these writes is wrapped in a KettleException with this localized message plus the id_step, with the original exception as cause.","triggerScenarios":"Saving a transformation to the repository when a saveStepAttribute call fails — repository DB unreachable, constraint violation, or insufficient permissions.","commonSituations":"Repository database offline or read-only; session/transaction invalidated after long idle; schema missing the Kettle step attribute tables; quota or permission limits on the repository user.","solutions":["Verify the repository database is up and the connection is valid","Inspect the cause (SQL exception) and fix schema/permissions issues","Reconnect to the repository and retry the save","Check the repository user's write privileges on step attribute tables"],"exampleFix":"// before\nstepMeta.saveRep(rep, metaStore, id_transformation, id_step);\n// after\ntry {\n  stepMeta.saveRep(rep, metaStore, id_transformation, id_step);\n} catch (KettleException e) {\n  logError(\"Save failed for id_step \" + id_step + \": \" + e.getCause());\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (rep == null || !rep.isConnected()) { throw new IllegalStateException(\"Repository not connected before saveRep\"); }","typeGuard":null,"tryCatchPattern":"try { meta.saveRep(rep, metaStore, id_transformation, id_step); } catch (KettleException e) { log.error(\"saveRep failed for id_step \" + id_step + \": \" + e.getCause(), e); /* reconnect and retry once */ }","preventionTips":["Check DB health before large save operations","Avoid long-idle repository sessions that get dropped","Grant write privileges on step attribute tables","Wrap saves in retry-once logic after reconnect"],"tags":["database","persistence","repository"],"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"}