{"record":{"id":"133f2dc4bf6348ab","repo":"pentaho/pentaho-kettle","slug":"replacestringmeta-exception-unabletoreadstepinfofromxml","errorCode":null,"errorMessage":"ReplaceStringMeta.Exception.UnableToReadStepInfoFromXML","messagePattern":"ReplaceStringMeta\\.Exception\\.UnableToReadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/replacestring/ReplaceStringMeta.java","lineNumber":260,"sourceCode":"\n        fieldInStream[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"in_stream_name\" ), \"\" );\n        fieldOutStream[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"out_stream_name\" ), \"\" );\n        useRegEx[i] = getFlagFromString( Const.NVL( XMLHandler.getTagValue( fnode, \"use_regex\" ), \"\" ) );\n        replaceString[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"replace_string\" ), \"\" );\n        replaceByString[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"replace_by_string\" ), \"\" );\n        String emptyString = XMLHandler.getTagValue( fnode, \"set_empty_string\" );\n\n        setEmptyString[i] = !Utils.isEmpty( emptyString ) && \"Y\".equalsIgnoreCase( emptyString );\n        replaceFieldByString[i] = Const.NVL( XMLHandler.getTagValue( fnode, \"replace_field_by_string\" ), \"\" );\n        wholeWord[i] = getFlagFromString( Const.NVL( XMLHandler.getTagValue( fnode, \"whole_word\" ), \"\" ) );\n        caseSensitive[i] =\n          getFlagFromString( Const.NVL( XMLHandler.getTagValue( fnode, \"case_sensitive\" ), \"\" ) );\n        isUnicode[i] =\n          getFlagFromString( Const.NVL( XMLHandler.getTagValue( fnode, \"is_unicode\" ), \"\" ) );\n\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"ReplaceStringMeta.Exception.UnableToReadStepInfoFromXML\" ), e );\n    }\n  }\n\n  private static boolean getFlagFromString( String tt ) {\n    return ( \"Y\".equalsIgnoreCase( tt ) || \"yes\".equalsIgnoreCase( tt )  || \"true\".equalsIgnoreCase( tt ) );\n  }\n\n  public void setDefault() {\n    fieldInStream = null;\n    fieldOutStream = null;\n    int nrkeys = 0;\n\n    allocate( nrkeys );\n  }\n\n  public String getXML() {\n    StringBuilder retval = new StringBuilder( 500 );","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/replacestring/ReplaceStringMeta.java#L242-L278","documentation":"ReplaceStringMeta.loadXML calls readData to parse the step's <fields> per-field XML nodes (in_stream_name, out_stream_name, replace_string, flags, etc.); any exception is wrapped in KettleXMLException 'ReplaceStringMeta.Exception.UnableToReadStepInfoFromXML'. The step configuration in the .ktr could not be deserialized.","triggerScenarios":"Loading a .ktr whose ReplaceString <fields> entries are malformed/missing tags, or where a flag string cannot be processed by getFlagFromString paths in readData.","commonSituations":"Hand-edited transformations; files saved by newer Pentaho versions opened in older ones; corrupted or truncated .ktr files.","solutions":["Inspect the ReplaceString step's <fields> XML in the .ktr for missing/malformed child tags.","Fix invalid flag values (use Y/N/true/false/yes/no).","Recreate the step in Spoon and reconfigure the mappings.","Open the file with the same or newer Pentaho version that saved it."],"exampleFix":"<!-- before: malformed field node -->\n<field><in_stream_name>foo</field>\n<!-- after -->\n<field><in_stream_name>foo</in_stream_name><out_stream_name>foo_out</out_stream_name></field>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["xml","deserialization","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"}