{"record":{"id":"2bb447dbd17d61e0","repo":"pentaho/pentaho-kettle","slug":"getpreviousrowfieldmeta-exception","errorCode":null,"errorMessage":"GetPreviousRowFieldMeta.Exception.UnableToReadStepInfoFromXML","messagePattern":"GetPreviousRowFieldMeta\\.Exception\\.UnableToReadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/get-previous-row-field/core/src/main/java/org/pentaho/di/trans/steps/getpreviousrowfield/GetPreviousRowFieldMeta.java","lineNumber":147,"sourceCode":"  }\n\n  private void readData( Node stepnode ) throws KettleXMLException {\n    try {\n      int nrkeys;\n\n      Node lookup = XMLHandler.getSubNode( stepnode, \"fields\" );\n      nrkeys = XMLHandler.countNodes( lookup, \"field\" );\n\n      allocate( nrkeys );\n\n      for ( int i = 0; i < nrkeys; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( lookup, \"field\", i );\n\n        fieldInStream[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"in_stream_name\" ), \"\" );\n        fieldOutStream[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"out_stream_name\" ), \"\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"GetPreviousRowFieldMeta.Exception.UnableToReadStepInfoFromXML\" ), e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    fieldInStream = null;\n    fieldOutStream = null;\n    schema = \"\";\n\n    int nrkeys = 0;\n\n    allocate( nrkeys );\n  }\n\n  @Override\n  public String getXML() {\n    StringBuffer retval = new StringBuffer( 500 );","sourceCodeStart":129,"sourceCodeEnd":165,"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#L129-L165","documentation":"GetPreviousRowFieldMeta.readData() parses the step's <field> nodes from transformation XML. Any unexpected exception while reading the XML (malformed nodes, wrong structure, casting issues) is wrapped in a KettleXMLException with this localized message and the original exception as cause.","triggerScenarios":"Loading a .ktr file whose GetPreviousRowField step XML is malformed — missing <lookup> node, corrupted <field> entries, or XML written by a different/incompatible plugin version.","commonSituations":"Hand-editing transformation XML and breaking the step structure; opening a transformation saved by a newer Pentaho version in an older one; truncated/corrupted .ktr files from bad checkouts or merges.","solutions":["Inspect the cause chain for the exact XML parsing failure and fix the .ktr XML","Re-open and re-save the step in Spoon to regenerate valid XML","Restore the transformation file from version control/backup","Align Pentaho/plugin versions between the file's origin and your runtime"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate XML before load: ensure each step node has a <lookup> with <field> children\nNode lookup = XMLHandler.getSubNode(stepnode, \"lookup\"); if (lookup == null || XMLHandler.getNodes(lookup, \"field\") == null) { throw new IllegalArgumentException(\"Corrupt GetPreviousRowField XML section\"); }","typeGuard":null,"tryCatchPattern":"try { meta.loadXML(stepnode, databases, metaStore); } catch (KettleXMLException e) { log.error(\"Step XML unreadable; restore file or re-create step\", e); }","preventionTips":["Do not hand-edit .ktr files; edit in Spoon","Keep Pentaho runtime version aligned with file producers","Commit .ktr files and verify after merges","Back up transformations before edits"],"tags":["xml","serialization","metadata"],"backgroundTag":"json-unmarshal-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"}