{"record":{"id":"aba93372dc19de6e","repo":"pentaho/pentaho-kettle","slug":"addsequencemeta-exception-errorloadingstepinfo","errorCode":null,"errorMessage":"AddSequenceMeta.Exception.ErrorLoadingStepInfo","messagePattern":"AddSequenceMeta\\.Exception\\.ErrorLoadingStepInfo","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/addsequence/AddSequenceMeta.java","lineNumber":248,"sourceCode":"      valuename = XMLHandler.getTagValue( stepnode, \"valuename\" );\n\n      useDatabase = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"use_database\" ) );\n      String conn = XMLHandler.getTagValue( stepnode, \"connection\" );\n      database = DatabaseMeta.findDatabase( databases, conn );\n      schemaName = XMLHandler.getTagValue( stepnode, \"schema\" );\n      sequenceName = XMLHandler.getTagValue( stepnode, \"seqname\" );\n\n      useCounter = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"use_counter\" ) );\n      counterName = XMLHandler.getTagValue( stepnode, \"counter_name\" );\n      startAt = XMLHandler.getTagValue( stepnode, \"start_at\" );\n      incrementBy = XMLHandler.getTagValue( stepnode, \"increment_by\" );\n      maxValue = XMLHandler.getTagValue( stepnode, \"max_value\" );\n\n      // TODO startAt = Const.toLong(XMLHandler.getTagValue(stepnode, \"start_at\"), 1);\n      // incrementBy = Const.toLong(XMLHandler.getTagValue(stepnode, \"increment_by\"), 1);\n      // maxValue = Const.toLong(XMLHandler.getTagValue(stepnode, \"max_value\"), 999999999L);\n    } catch ( Exception e ) {\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"AddSequenceMeta.Exception.ErrorLoadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    valuename = \"valuename\";\n\n    useDatabase = false;\n    schemaName = \"\";\n    sequenceName = \"SEQ_\";\n    database = null;\n\n    useCounter = true;\n    counterName = null;\n    startAt = \"1\";\n    incrementBy = \"1\";\n    maxValue = \"999999999\";","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/addsequence/AddSequenceMeta.java#L230-L266","documentation":"AddSequenceMeta.readData() wraps all XMLHandler tag parsing of the step's serialized <fields> node in a try/catch and rethrows any Exception as a KettleXMLException with this message. It means the step's XML fragment in the .ktr file is malformed or contains values that cannot be parsed (e.g. non-numeric counter values), so the step metadata could not be loaded from XML.","triggerScenarios":"loadXML() calls readData(stepnode) and XMLHandler.getTagValue or subsequent parsing throws — corrupt/truncated transformation XML, unexpected node structure, or attribute values of wrong type inside the AddSequence step node.","commonSituations":"A .ktr file edited by hand or damaged by an interrupted save; transformation produced by an incompatible plugin or newer Kettle version with a different XML schema; copy-paste of step XML that lost required child tags.","solutions":["Open the .ktr in a text editor and inspect the AddSequence step's XML node for malformed or missing tags; repair or remove the broken step node","Recreate the AddSequence step in Spoon and re-save the transformation to regenerate valid XML","Check the Kettle version that produced the file versus the one loading it; upgrade or migrate the file if schemas differ","Look at the wrapped cause 'e' in the exception stack trace to pinpoint exactly which tag failed to parse"],"exampleFix":"// before: hand-edited step XML with non-numeric counter\n<start_at>one</start_at>\n// after\n<start_at>1</start_at>","handlingStrategy":"try-catch","validationCode":"Document doc = XMLHandler.loadXMLFile(ktrFile);\nNode stepNode = findStepNode(doc, \"AddSequence\");\nif (stepNode == null || XMLHandler.getTagValue(stepNode, \"valuename\") == null)\n  throw new IllegalStateException(\"AddSequence step XML node missing or incomplete\");","typeGuard":"boolean isParsableLong(String v) {\n  if (v == null || v.isEmpty()) return false;\n  try { Long.parseLong(v.trim()); return true; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try {\n  transMeta.loadXML(file, null, metaStore, true);\n} catch (KettleXMLException e) {\n  if (e.getMessage().contains(\"ErrorLoadingStepInfo\")) {\n    logError(\"Corrupt AddSequence step XML: \" + e.getCause());\n    // fall back to rebuilding the step\n  } else throw e;\n}","preventionTips":["Never hand-edit .ktr XML without validating the result in Spoon","Keep generating and consuming Kettle versions aligned; migrate files when upgrading","Back up transformations before automated edits","When the exception fires, inspect the wrapped cause to identify the failing tag"],"tags":["kettle","pentaho","xml","serialization","metadata-loading"],"backgroundTag":"xml-parse-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"}