{"record":{"id":"87e6a0bf4ef14ff6","repo":"pentaho/pentaho-kettle","slug":"changefileencodingmeta-exception-unabletoreadstepinfo","errorCode":"ChangeFileEncodingMeta.Exception.UnableToReadStepInfo","errorMessage":"ChangeFileEncodingMeta.Exception.UnableToReadStepInfo","messagePattern":"ChangeFileEncodingMeta\\.Exception\\.UnableToReadStepInfo","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncodingMeta.java","lineNumber":192,"sourceCode":"    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"addsourceresultfilenames\", addsourceresultfilenames ) );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"addtargetresultfilenames\", addtargetresultfilenames ) );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"createparentfolder\", createparentfolder ) );\n\n    return retval.toString();\n  }\n\n  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {\n    try {\n      filenamefield = XMLHandler.getTagValue( stepnode, \"filenamefield\" );\n      targetfilenamefield = XMLHandler.getTagValue( stepnode, \"targetfilenamefield\" );\n      sourceencoding = XMLHandler.getTagValue( stepnode, \"sourceencoding\" );\n      targetencoding = XMLHandler.getTagValue( stepnode, \"targetencoding\" );\n      addsourceresultfilenames = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"addsourceresultfilenames\" ) );\n      addtargetresultfilenames = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"addtargetresultfilenames\" ) );\n      createparentfolder = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"createparentfolder\" ) );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException(\n          BaseMessages.getString( PKG, \"ChangeFileEncodingMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )\n    throws KettleException {\n    try {\n      filenamefield = rep.getStepAttributeString( id_step, \"filenamefield\" );\n      targetfilenamefield = rep.getStepAttributeString( id_step, \"targetfilenamefield\" );\n      sourceencoding = rep.getStepAttributeString( id_step, \"sourceencoding\" );\n      targetencoding = rep.getStepAttributeString( id_step, \"targetencoding\" );\n\n      addsourceresultfilenames = rep.getStepAttributeBoolean( id_step, \"addsourceresultfilenames\" );\n      addtargetresultfilenames = rep.getStepAttributeBoolean( id_step, \"addtargetresultfilenames\" );\n      createparentfolder = rep.getStepAttributeBoolean( id_step, \"createparentfolder\" );\n\n    } catch ( Exception e ) {\n      throw new KettleException(","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncodingMeta.java#L174-L210","documentation":"ChangeFileEncodingMeta.readData() wraps XML parsing of the step's serialized configuration in a try/catch and rethrows as KettleXMLException with this message when loading the step from a transformation .ktr file. It indicates the step XML node is malformed or contains unexpected content.","triggerScenarios":"In readData (called from loadXML): XMLHandler.getTagValue calls on the stepnode throw — e.g. stepnode is null, the XML is corrupted, or a hand-edited .ktr broke the <fields> structure of this step.","commonSituations":"Hand-editing or partial copy/paste of a .ktr file; transformation produced by an older Pentaho version with incompatible step XML; file truncated on disk or in version control.","solutions":["Open the .ktr in Spoon and re-create the Change File Encoding step.","Compare the step's XML block against a freshly saved step and repair missing tags (sourcename, targetname, sourceencoding, targetencoding, etc.).","Restore the transformation file from backup/version control.","Ensure the plugin version matches the Pentaho version that wrote the file."],"exampleFix":"<!-- before: missing tags -->\n<step><name>Change file encoding</name><type>ChangeFileEncoding</type></step>\n<!-- after: restore required fields -->\n<step><name>Change file encoding</name><type>ChangeFileEncoding</type>\n  <sourceencoding>UTF-8</sourceencoding><targetencoding>ISO-8859-1</targetencoding></step>","handlingStrategy":"try-catch","validationCode":"// Validate the .ktr is well-formed XML before loading\nimport javax.xml.parsers.DocumentBuilderFactory;\nDocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File( \"t.ktr\" ) ); // throws on malformed XML","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta( \"t.ktr\" );\n} catch ( KettleXMLException e ) {\n  if ( e.getMessage().contains( \"UnableToReadStepInfo\" ) ) {\n    log.error( \"Corrupt ChangeFileEncoding step XML: {}\", e.getCause(), e );\n  } else { throw e; }\n}","preventionTips":["Do not hand-edit .ktr files; edit via Spoon only.","Keep transformation files in version control so corruption can be reverted.","Use the same Pentaho version to write and read transformation files."],"tags":["etl","kettle","xml","serialization"],"backgroundTag":"json-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"}