{"record":{"id":"a215898a0b569440","repo":"pentaho/pentaho-kettle","slug":"scriptvaluesmetamod-exception-unabletoloadstepinfofromxml","errorCode":null,"errorMessage":"ScriptValuesMetaMod.Exception.UnableToLoadStepInfoFromXML","messagePattern":"ScriptValuesMetaMod\\.Exception\\.UnableToLoadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java","lineNumber":363,"sourceCode":"      int nrfields = XMLHandler.countNodes( fields, \"field\" );\n\n      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        fieldname[i] = XMLHandler.getTagValue( fnode, \"name\" );\n        rename[i] = XMLHandler.getTagValue( fnode, \"rename\" );\n        type[i] = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( fnode, \"type\" ) );\n\n        String slen = XMLHandler.getTagValue( fnode, \"length\" );\n        String sprc = XMLHandler.getTagValue( fnode, \"precision\" );\n        length[i] = Const.toInt( slen, -1 );\n        precision[i] = Const.toInt( sprc, -1 );\n        replace[i] = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( fnode, \"replace\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"ScriptValuesMetaMod.Exception.UnableToLoadStepInfoFromXML\" ), e );\n    }\n  }\n\n  public void setDefault() {\n    jsScripts = new ScriptValuesScript[1];\n    jsScripts[0] =\n      new ScriptValuesScript( ScriptValuesScript.TRANSFORM_SCRIPT, BaseMessages.getString(\n        PKG, \"ScriptValuesMod.Script1\" ), \"//\"\n        + BaseMessages.getString( PKG, \"ScriptValuesMod.ScriptHere\" ) + Const.CR + Const.CR );\n\n    int nrfields = 0;\n    allocate( nrfields );\n\n    for ( int i = 0; i < nrfields; i++ ) {\n      fieldname[i] = \"newvalue\";\n      rename[i] = \"newvalue\";\n      type[i] = ValueMetaInterface.TYPE_NUMBER;","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java#L345-L381","documentation":"ScriptValuesMetaMod.readData(), invoked from loadXML when deserializing the step from a .ktr transformation file, wraps XML parsing in a try/catch and re-throws as a KettleXMLException with the localized message 'UnableToLoadStepInfoFromXML'. It means the step's XML block is malformed or missing expected tags.","triggerScenarios":"Loading a transformation whose <step type='ScriptValueMod'> XML contains unexpected structure or invalid values (e.g. non-numeric length/precision).","commonSituations":"Hand-edited .ktr files, transformations produced by older/newer Pentaho versions with schema drift, or truncated/corrupted files.","solutions":["Open the .ktr in Spoon and inspect the ScriptValuesMod step XML; fix malformed tags.","Restore the transformation from backup or version control.","Compare the failing step XML against a working transformation's step XML.","Check the cause (nested exception) logged with the KettleXMLException for the exact parse failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { trans.loadXML(file, monitor, false); } catch (KettleXMLException e) {\n  logError('Failed to load step from XML: ' + e.getMessage(), e.getCause());\n}","preventionTips":["Do not hand-edit .ktr files; edit in Spoon.","Keep transformations in version control for restoration.","Match Pentaho versions when moving transformations between environments."],"tags":["kettle","xml","deserialization","transformation"],"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"}