{"record":{"id":"db27e135a3575026","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-step-information-from-xml-db27e1","errorCode":null,"errorMessage":"Unable to read step information from XML","messagePattern":"Unable to read step information from XML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/secretkeygenerator/SecretKeyGeneratorMeta.java","lineNumber":249,"sourceCode":"      allocate( count );\n\n      for ( int i = 0; i < count; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        algorithm[i] = XMLHandler.getTagValue( fnode, \"algorithm\" );\n        scheme[i] = XMLHandler.getTagValue( fnode, \"scheme\" );\n        secretKeyLength[i] = XMLHandler.getTagValue( fnode, \"secretKeyLen\" );\n        secretKeyCount[i] = XMLHandler.getTagValue( fnode, \"secretKeyCount\" );\n      }\n\n      secretKeyFieldName = XMLHandler.getTagValue( stepnode, \"secretKeyFieldName\" );\n      secretKeyLengthFieldName = XMLHandler.getTagValue( stepnode, \"secretKeyLengthFieldName\" );\n      algorithmFieldName = XMLHandler.getTagValue( stepnode, \"algorithmFieldName\" );\n\n      outputKeyInBinary = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"outputKeyInBinary\" ) );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to read step information from XML\", e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    int count = 0;\n\n    allocate( count );\n\n    for ( int i = 0; i < count; i++ ) {\n      algorithm[i] = \"field\" + i;\n      scheme[i] = \"\";\n      secretKeyLength[i] = \"\";\n      secretKeyCount[i] = \"\";\n    }\n    secretKeyFieldName = BaseMessages.getString( PKG, \"SecretKeyGeneratorMeta.secretKeyField\" );\n    secretKeyLengthFieldName = BaseMessages.getString( PKG, \"SecretKeyGeneratorMeta.secretKeyLengthField\" );\n    algorithmFieldName = BaseMessages.getString( PKG, \"SecretKeyGeneratorMeta.algorithmField\" );","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/secretkeygenerator/SecretKeyGeneratorMeta.java#L231-L267","documentation":"SecretKeyGeneratorMeta.loadXML throws KettleXMLException with this message when any exception occurs while parsing the step's XML node via XMLHandler.getTagValue calls. It wraps the underlying parse failure so transformation deserialization fails fast with step context. It is a wrapper exception: the cause holds the real problem.","triggerScenarios":"Calling loadXML(Node stepnode) on XML that is malformed, missing expected tags (secretKeyFieldName, secretKeyLengthFieldName, algorithmFieldName, outputKeyInBinary), or whose node is null/empty so XMLHandler throws.","commonSituations":"Opening a .ktr file edited by hand or by a different Pentaho/Kettle version; truncated XML export; a step node copied from another step type; corrupted repository-to-XML export.","solutions":["Inspect the wrapped cause (e.getCause()) of the KettleXMLException to find the real parse failure","Open the .ktr in a text editor and verify the <secret_key_generator> step node contains all expected child tags","Re-export or recreate the transformation step in Spoon rather than hand-editing XML","Check Pentaho version compatibility: XML produced by a much older/newer Kettle version may lack tags; loadXML tolerates missing tags but not malformed nodes"],"exampleFix":"// before: hand-edited XML missing tags\n<step><name>gen</name></step>\n// after: complete node\n<step><name>gen</name><secretKeyFieldName>key</secretKeyFieldName><secretKeyLengthFieldName>len</secretKeyLengthFieldName><algorithmFieldName>alg</algorithmFieldName><outputKeyInBinary>N</outputKeyInBinary></step>","handlingStrategy":"try-catch","validationCode":"// before loadXML\nif (stepnode == null || !stepnode.hasChildNodes()) {\n  throw new IllegalArgumentException(\"Step node is empty or missing\");\n}","typeGuard":null,"tryCatchPattern":"try { meta.loadXML(node, ...); } catch (KettleXMLException e) { log.error(\"Step XML invalid: \" + e.getCause(), e); }","preventionTips":["Never hand-edit .ktr XML; use Spoon","Keep Pentaho versions consistent across environments","Validate exports against the Kettle XSD before loading"],"tags":["xml","deserialization","kettle","step-metadata"],"backgroundTag":"xml-parse-error","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"}