{"record":{"id":"55ed88c4cac15c12","repo":"pentaho/pentaho-kettle","slug":"dynamicsqlrowmeta-exception-unabletoloadstepinfo","errorCode":null,"errorMessage":"DynamicSQLRowMeta.Exception.UnableToLoadStepInfo","messagePattern":"DynamicSQLRowMeta\\.Exception\\.UnableToLoadStepInfo","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java","lineNumber":199,"sourceCode":"    DynamicSQLRowMeta retval = (DynamicSQLRowMeta) super.clone();\n\n    return retval;\n  }\n\n  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {\n    try {\n      String con = XMLHandler.getTagValue( stepnode, \"connection\" );\n      databaseMeta = DatabaseMeta.findDatabase( databases, con );\n      sql = XMLHandler.getTagValue( stepnode, \"sql\" );\n      outerJoin = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"outer_join\" ) );\n      replacevars = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"replace_vars\" ) );\n      queryonlyonchange = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"query_only_on_change\" ) );\n\n      rowLimit = Const.toInt( XMLHandler.getTagValue( stepnode, \"rowlimit\" ), 0 );\n      sqlfieldname = XMLHandler.getTagValue( stepnode, \"sql_fieldname\" );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"DynamicSQLRowMeta.Exception.UnableToLoadStepInfo\" ), e );\n    }\n  }\n\n  public void setDefault() {\n    databaseMeta = null;\n    rowLimit = 0;\n    sql = \"\";\n    outerJoin = false;\n    replacevars = false;\n    sqlfieldname = null;\n    queryonlyonchange = false;\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java#L181-L217","documentation":"DynamicSQLRowMeta.readData wraps any exception thrown while parsing the step's XML node (via XMLHandler tag lookups) into a KettleXMLException with this message key, called from loadXML. It means the step's XML definition could not be parsed into step metadata.","triggerScenarios":"Loading a .ktr file whose Dynamic SQL Row step XML is malformed or has unexpected structure, causing XMLHandler.getTagValue or related calls to throw inside readData.","commonSituations":"Hand-edited or truncated .ktr files; transformation files from newer/older Pentaho versions with different tags; corrupted XML from bad merges or transfer (encoding issues).","solutions":["Inspect the wrapped cause (e.getCause()) to find the exact parse failure","Validate/repair the .ktr XML (open in an XML editor, check the step's <fields> block)","Re-create the Dynamic SQL Row step in Spoon and re-save the transformation","Align file versions — open the transformation with the same PDI version that produced it"],"exampleFix":"// before\n<step><name>Dynamic SQL row</name><sql>SELECT ...</sql>   // truncated file\n// after\ncomplete the step XML including <sql_fieldname>, <query_only_on_change>, <rowlimit> tags and re-save from Spoon","handlingStrategy":"validation","validationCode":"// Validate the .ktr XML before loading:\nDocumentBuilderFactory f = DocumentBuilderFactory.newInstance();\nf.setValidating(false);\nDocument doc = f.newDocumentBuilder().parse(new File(ktrPath)); // throws if malformed\nif (doc.getElementsByTagName(\"sql_fieldname\").getLength() == 0) {\n  System.out.println(\"Warning: Dynamic SQL Row step missing sql_fieldname tag\");\n}","typeGuard":null,"tryCatchPattern":"try (InputStream in = new FileInputStream(ktrPath)) {\n  transMeta = new TransMeta(in, null, false, vars, null);\n} catch (KettleXMLException e) {\n  logError(\"Failed parsing transformation XML: \" + e.getCause(), e);\n  throw e;\n}","preventionTips":["Don't hand-edit .ktr files; use Spoon","Keep source .ktr files in version control to detect corruption","Validate XML after merges or automated generation","Match the PDI version when loading transformations from other environments"],"tags":["kettle","xml","deserialization"],"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"}