{"record":{"id":"283694fd05ddd0ac","repo":"pentaho/pentaho-kettle","slug":"selectvaluesmeta-exception-unabletoreadstepinfofromxml","errorCode":null,"errorMessage":"SelectValuesMeta.Exception.UnableToReadStepInfoFromXML","messagePattern":"SelectValuesMeta\\.Exception\\.UnableToReadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/selectvalues/SelectValuesMeta.java","lineNumber":295,"sourceCode":"        selectFields[i].setRename( XMLHandler.getTagValue( line, \"rename\" ) );\n        selectFields[i].setLength( Const.toInt( XMLHandler.getTagValue( line, \"length\" ), UNDEFINED ) ); // $NON-NtagLS-1$\n        selectFields[i].setPrecision( Const.toInt( XMLHandler.getTagValue( line, \"precision\" ), UNDEFINED ) );\n      }\n      selectingAndSortingUnspecifiedFields =\n          \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( fields, \"select_unspecified\" ) );\n\n      for ( int i = 0; i < nrremove; i++ ) {\n        Node line = XMLHandler.getSubNodeByNr( fields, \"remove\", i );\n        deleteName[i] = XMLHandler.getTagValue( line, \"name\" );\n      }\n\n      for ( int i = 0; i < nrmeta; i++ ) {\n        Node metaNode = XMLHandler.getSubNodeByNr( fields, SelectMetadataChange.XML_TAG, i );\n        meta[i] = new SelectMetadataChange( this );\n        meta[i].loadXML( metaNode );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG,\n          \"SelectValuesMeta.Exception.UnableToReadStepInfoFromXML\" ), e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    allocate( 0, 0, 0 );\n  }\n\n  public void getSelectFields( RowMetaInterface inputRowMeta, String name ) throws KettleStepException {\n    RowMetaInterface row;\n\n    if ( selectFields != null && selectFields.length > 0 ) { // SELECT values\n\n      // 0. Start with an empty row\n      // 1. Keep only the selected values\n      // 2. Rename the selected values\n      // 3. Keep the order in which they are specified... (not the input order!)","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/selectvalues/SelectValuesMeta.java#L277-L313","documentation":"Thrown by SelectValuesMeta.readData() when parsing the step's XML definition fails. Any Exception raised while reading the Select/Metadata/Delete node structure (via XMLHandler) is wrapped in a KettleXMLException with 'Unable to read step info from XML'. This happens while loading a transformation (.ktr) or importing step metadata, not during execution.","triggerScenarios":"XMLHandler calls (getSubNode, getNodeValue, getSubNodeByNr) or SelectMetadataChange.loadXML throw — due to malformed XML, missing required nodes, or attributes with unexpected values — while loadXML() deserializes the SelectValues step.","commonSituations":"Hand-edited or truncated .ktr file, transformation produced by a different/newer Pentaho version with changed XML tags, corrupted repository export, or copy-paste between transformations losing required child nodes.","solutions":["Look at the chained cause to find the exact XML node/attribute that failed to parse","Open the .ktr in a text editor and fix/restore the malformed <fields> section of the step","Recreate the Select Values step in Spoon and re-enter its configuration","Check version compatibility: open the transformation with the version that wrote it, then re-save","Restore the file from backup or source control"],"exampleFix":"// before: hand-edited XML missing required node\n<fields>\n  <field><name>a</name></field>\n</fields>\n// after: correct structure with rename/convert nodes\n<fields>\n  <field><name>a</name><rename>a2</rename><convert>Type</convert></field>\n</fields>","handlingStrategy":"try-catch","validationCode":"// Sanity-check the step XML before loading the transformation\nNode fields = XMLHandler.getSubNode( stepnode, \"fields\" );\nif ( fields == null ) {\n  throw new IllegalStateException( \"SelectValues step XML is missing <fields> node\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta( fileName );\n} catch ( KettleXMLException e ) {\n  if ( e.getMessage().contains( \"Unable to read step info from XML\" ) ) {\n    logError( \"Corrupt step XML in transformation: \" + e.getCause(), e );\n  }\n  throw e;\n}","preventionTips":["Don't hand-edit .ktr files; use Spoon to modify steps","Keep transformations in version control to restore known-good XML","Open and re-save transformations with the same Pentaho version that created them","Validate XML well-formedness after any external tooling touches the file"],"tags":["xml","serialization","metadata-loading","ktr"],"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"}