{"record":{"id":"e08ccc539039f291","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-the-kettle-xml-config-file-xmlfile","errorCode":null,"errorMessage":"Unable to read the kettle XML config file: ${xmlFile}","messagePattern":"Unable to read the kettle XML config file: (.+?)","errorType":"exception","errorClass":"KettlePluginException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/plugins/BasePluginType.java","lineNumber":230,"sourceCode":"        try {\n          inputStream = getFileInputStreamExternal( xmlFile );\n        } catch ( Exception e ) {\n          throw new KettlePluginException( \"Unable to load native plugins '\" + xmlFile + \"'\", e );\n        }\n      }\n\n      if ( inputStream == null ) {\n        if ( isReturn() ) {\n          return;\n        } else {\n          throw new KettlePluginException( \"Unable to find native plugins definition file: \" + xmlFile );\n        }\n      }\n\n      registerPlugins( inputStream );\n\n    } catch ( KettleXMLException e ) {\n      throw new KettlePluginException( \"Unable to read the kettle XML config file: \" + xmlFile, e );\n    } finally {\n      IOUtils.closeQuietly( inputStream );\n    }\n  }\n\n  @VisibleForTesting\n  protected String getPropertyExternal( String key, String def ) {\n    return System.getProperty( key, def );\n  }\n\n  @VisibleForTesting\n  protected InputStream getResAsStreamExternal( String name ) {\n    return getClass().getResourceAsStream( name );\n  }\n\n  @VisibleForTesting\n  protected InputStream getFileInputStreamExternal( String name ) throws FileNotFoundException {\n    return new FileInputStream( name );","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/plugins/BasePluginType.java#L212-L248","documentation":"Once the native plugin XML input stream is obtained, registerNatives parses it via registerPlugins. If parsing raises KettleXMLException (malformed XML, unexpected structure), it is rethrown as KettlePluginException 'Unable to read the kettle XML config file'. The stream is always closed in the finally block. This indicates the plugin definition file exists but is unreadable/invalid.","triggerScenarios":"registerNatives() -> registerPlugins(inputStream) throwing KettleXMLException because the native plugin XML is malformed (bad tag structure, encoding issues, truncated file) or a custom replacement file has invalid content.","commonSituations":"Hand-editing a plugin XML and introducing a syntax error; a partial/corrupted download or installation of kettle-core; supplying a custom plugin definition file with the wrong schema (missing <plugin> elements).","solutions":["Validate the XML file named in the message with an XML parser / xmllint and fix syntax errors.","Restore the original plugin XML from a clean Pentaho install or jar if it was modified.","If using a custom/alternative definition file, correct its structure to match the expected <plugins><plugin .../> schema.","Check the wrapped cause for the exact XML parse error (line/column)."],"exampleFix":"// before\n<plugins><plugin id='x' class='Foo'></plugins> <!-- missing close tag -->\n// after\n<plugins><plugin id='x' class='Foo'></plugin></plugins>","handlingStrategy":"try-catch","validationCode":"File xml = new File(xmlFile);\nif (xml.exists()) {\n  try { new javax.xml.parsers.DocumentBuilderFactory().newDocumentBuilder().parse(xml); }\n  catch (Exception e) { throw new IllegalStateException(\"Invalid plugin XML: \" + e.getMessage(), e); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  pluginType.searchPlugins();\n} catch (KettlePluginException e) {\n  Throwable cause = e.getCause(); // KettleXMLException with parse details\n  log.logError(\"Malformed plugin XML: \" + (cause != null ? cause.getMessage() : e.getMessage()), e);\n}","preventionTips":["Never hand-edit native plugin XMLs without validating afterwards.","Validate XML with xmllint or a parser before deploying custom definition files.","Restore modified XMLs from a clean install.","Watch getCause() for line/column of the parse failure."],"tags":["kettle","plugins","xml","parse-error"],"backgroundTag":"schema-validation-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"}