{"record":{"id":"c1a98b202ec1c213","repo":"pentaho/pentaho-kettle","slug":"processfilesmeta-exception-unabletoreadstepinfo","errorCode":null,"errorMessage":"ProcessFilesMeta.Exception.UnableToReadStepInfo","messagePattern":"ProcessFilesMeta\\.Exception\\.UnableToReadStepInfo","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFilesMeta.java","lineNumber":251,"sourceCode":"    if ( i < 0 || i >= operationTypeCode.length ) {\n      return operationTypeCode[0];\n    }\n    return operationTypeCode[i];\n  }\n\n  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {\n    try {\n      sourcefilenamefield = XMLHandler.getTagValue( stepnode, \"sourcefilenamefield\" );\n      targetfilenamefield = XMLHandler.getTagValue( stepnode, \"targetfilenamefield\" );\n      operationType =\n        getOperationTypeByCode( Const.NVL( XMLHandler.getTagValue( stepnode, \"operation_type\" ), \"\" ) );\n      addresultfilenames = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"addresultfilenames\" ) );\n      overwritetargetfile = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"overwritetargetfile\" ) );\n      createparentfolder = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"createparentfolder\" ) );\n      simulate = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"simulate\" ) );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages\n        .getString( PKG, \"ProcessFilesMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\n  }\n\n  private static int getOperationTypeByCode( String tt ) {\n    if ( tt == null ) {\n      return 0;\n    }\n\n    for ( int i = 0; i < operationTypeCode.length; i++ ) {\n      if ( operationTypeCode[i].equalsIgnoreCase( tt ) ) {\n        return i;\n      }\n    }\n    return 0;\n  }\n\n  @Override","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFilesMeta.java#L233-L269","documentation":"Thrown by ProcessFilesMeta.loadXML/readData when any exception occurs while parsing the step's XML node (getTagValue calls). It wraps the underlying exception in a KettleXMLException indicating the step definition could not be read from a .ktr file.","triggerScenarios":"loadXML() encounters malformed or unexpected XML for the ProcessFiles step; XMLHandler.getTagValue throws or the code throws inside the try block (e.g. NPE on null stepnode).","commonSituations":"Hand-edited or truncated .ktr/.xml file; transformation saved by a newer PDI version with unsupported tags; XML encoding corruption; step XML missing required child tags.","solutions":["Open and re-save the transformation in Spoon matching your PDI version to regenerate valid XML.","Inspect the cause chain (the wrapped exception) to find the exact malformed element in the .ktr file.","Fix or remove the corrupted <step> XML block manually in the .ktr file.","Restore the transformation from version control or a backup."],"exampleFix":"// before (corrupt step XML)\n<field_name/>\n// after (valid generated XML)\n<dynamic_source_filename_field>filename</dynamic_source_filename_field>\n<dynamic_target_filename_field>target</dynamic_target_filename_field>","handlingStrategy":"try-catch","validationCode":"// Validate the .ktr XML parses and contains the step before loading:\nDocument doc = XMLHandler.loadXMLFile(ktrFile);\nNode step = XMLHandler.getSubNode(doc, \"transformation\", \"step\"); // iterate steps, check type ProcessFiles","typeGuard":"boolean stepXmlComplete(Node stepNode) {\n  return stepNode != null\n    && XMLHandler.getTagValue(stepNode, \"dynamic_source_filename_field\") != null;\n}","tryCatchPattern":"try {\n  transMeta.loadXML(file, null, metaStore, null, null, null);\n} catch (KettleXMLException e) {\n  if (e.getMessage().contains(\"UnableToReadStepInfo\")) {\n    logError(\"Corrupt ProcessFiles step XML; inspect cause: \" + e.getCause());\n  } else throw e;\n}","preventionTips":["Never hand-edit .ktr XML; edit via Spoon","Keep PDI client and server versions aligned with saved transformations","Keep transformations in version control for easy restore","Validate transformations after upgrades before production use"],"tags":["pdi","kettle","xml-parse","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"}