{"record":{"id":"24e3999ae8b864c8","repo":"pentaho/pentaho-kettle","slug":"unable-to-create-new-database-interface","errorCode":null,"errorMessage":"Unable to create new database interface","messagePattern":"Unable to create new database interface","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java","lineNumber":1003,"sourceCode":"  }\n\n  /**\n   * Reads the information from an XML Node into this new database connection.\n   *\n   * @param con\n   *          The Node to read the data from\n   * @throws KettleXMLException\n   */\n  public DatabaseMeta( Node con ) throws KettleXMLException {\n    this();\n\n    try {\n      String type = XMLHandler.getTagValue( con, \"type\" );\n      try {\n        databaseInterface = getDatabaseInterface( type );\n\n      } catch ( KettleDatabaseException kde ) {\n        throw new KettleXMLException( \"Unable to create new database interface\", kde );\n      }\n      \n      setDefaultAttributesValues();\n\n      String name = XMLHandler.getTagValue( con, \"name\" );\n      if ( name == null ) {\n        name = \"\";\n      }\n      setName( name );\n      setDisplayName( getName() );\n      setHostname( XMLHandler.getTagValue( con, \"server\" ) );\n      String acc = XMLHandler.getTagValue( con, \"access\" );\n      setAccessType( getAccessType( acc ) );\n\n      setDBName( XMLHandler.getTagValue( con, \"database\" ) );\n\n      // The DB port is read here too for backward compatibility! getName()\n      //","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java#L985-L1021","documentation":"The XML DatabaseMeta constructor (DatabaseMeta(Node con)) parses a <connection> node; when the <type> tag cannot be resolved to a registered database plugin, getDatabaseInterface throws KettleDatabaseException which is wrapped in KettleXMLException(\"Unable to create new database interface\"). It indicates the serialized connection references a database type unavailable in this environment.","triggerScenarios":"Loading a .ktr/.kjb or shared connection XML whose <type> element names a plugin not installed; corrupt/empty <type> tag in the XML file.","commonSituations":"Moving transformations between Pentaho servers where only one side has a vendor plugin; hand-edited XML; older exports referencing long-removed database types (e.g. legacy DB2 variants).","solutions":["Open the XML, inspect the <type> tag, and correct it to an installed type (e.g. ORACLE, MSSQL, POSTGRESQL).","Install the referenced database plugin on the target environment and restart.","Re-save the connection metadata on the target system using a generic JDBC (GENERIC) connection if the plugin is unavailable.","Validate XML before load by checking the type against DatabaseMeta.getDatabaseInterfaces().keySet()."],"exampleFix":"// before\nDatabaseMeta meta = new DatabaseMeta(XMLHandler.getSubNode(transMeta, \"connection\"));\n// after\nNode con = XMLHandler.getSubNode(transMeta, \"connection\");\nString type = XMLHandler.getTagValue(con, \"type\");\nif (type == null || DatabaseMeta.findDatabaseInterface(type) == null) {\n  XMLHandler.setTagValue(con, \"type\", \"GENERIC\"); // or abort with a clear message\n}\nDatabaseMeta meta = new DatabaseMeta(con);","handlingStrategy":"validation","validationCode":"Node con = XMLHandler.getSubNode(doc, \"connection\");\nString type = XMLHandler.getTagValue(con, \"type\");\nif (type == null || DatabaseMeta.findDatabaseInterface(type) == null) {\n  throw new InvalidMetadataException(\"Connection type unavailable: \" + type);\n}","typeGuard":null,"tryCatchPattern":"try {\n  DatabaseMeta meta = new DatabaseMeta(con);\n} catch (KettleXMLException e) {\n  if (e.getCause() instanceof KettleDatabaseException) {\n    // type plugin missing — swap to GENERIC or abort deployment\n  } else { throw e; }\n}","preventionTips":["Pre-validate the <type> tag before constructing DatabaseMeta from XML.","Ensure plugins referenced by exported artifacts exist on all target servers.","Avoid manual XML edits; re-export connections from Spoon."],"tags":["xml","database","plugin","deserialization"],"backgroundTag":"entity-not-found","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"}