{"record":{"id":"3e8c4db39c4a4608","repo":"pentaho/pentaho-kettle","slug":"failed-to-fetch-driver-metadata-for-driverid-from","errorCode":null,"errorMessage":"Failed to fetch driver metadata for '{driverId}' from '{metadataUrl}': {message}","messagePattern":"Failed to fetch driver metadata for '(.+?)' from '(.+?)': (.+?)","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/Database.java","lineNumber":762,"sourceCode":"\n      String bearerToken = CmsTokenProvider.getInstance().getToken();\n      if ( bearerToken != null ) {\n        conn.setRequestProperty( \"Authorization\", \"Bearer \" + bearerToken );\n      }\n\n      int status = conn.getResponseCode();\n      if ( status != HttpURLConnection.HTTP_OK ) {\n        throw new KettleDatabaseException(\n          \"Failed to fetch driver metadata for '\" + driverId + \"' — HTTP \" + status + \" from \" + metadataUrl );\n      }\n\n      try ( java.io.InputStream is = conn.getInputStream() ) {\n        return new ObjectMapper().readValue( is, Map.class );\n      }\n    } catch ( KettleDatabaseException e ) {\n      throw e;\n    } catch ( Exception e ) {\n      throw new KettleDatabaseException(\n        \"Failed to fetch driver metadata for '\" + driverId + \"' from '\" + metadataUrl + \"': \" + e.getMessage(), e );\n    } finally {\n      if ( conn != null ) {\n        conn.disconnect();\n      }\n    }\n  }\n\n  /**\n   * Disconnect from the database and close all open prepared statements.\n   */\n  public synchronized void disconnect() {\n    try {\n      if ( connection == null || connection.isClosed() ) {\n        closeDynamicClassLoader();\n        return; // Nothing to do...\n      }\n    } catch ( SQLException ex ) {","sourceCodeStart":744,"sourceCodeEnd":780,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/Database.java#L744-L780","documentation":"Catch-all failure while fetching or parsing driver metadata: any Exception that is not a KettleDatabaseException during the HTTP request or JSON deserialization (new ObjectMapper().readValue) is rethrown as this error, preserving the cause message. This covers connection failures, malformed URLs, IO errors, and non-JSON bodies.","triggerScenarios":"driverMetadata -> getMetadataFromDriver: malformed JDBC_DRIVER_SERVICE_URL (MalformedURLException), host unreachable (ConnectException/UnknownHostException), connection reset/timeout, or the response body is not valid JSON / doesn't fit a Map.","commonSituations":"Metadata service hostname wrong or DNS broken; service returns an HTML error page instead of JSON; TLS handshake failure; typo in service URL scheme (htp://); response interrupted by proxy.","solutions":["Read the cause message in the exception — it names the underlying IO/parse problem","Test the exact metadataUrl (printed in the error) with curl to see what the service actually returns","Fix JDBC_DRIVER_SERVICE_URL scheme/host/port if the URL itself is malformed or the host is unreachable","Check network/firewall/proxy rules between PDI and the metadata service","If the body is invalid JSON, fix or upgrade the metadata service"],"exampleFix":"// before\nexport JDBC_DRIVER_SERVICE_URL=htp://metadata:8080  // bad scheme -> MalformedURLException\n// after\nexport JDBC_DRIVER_SERVICE_URL=http://metadata:8080","handlingStrategy":"try-catch","validationCode":"try { new URL(baseUrl).toURI(); } catch (URISyntaxException e) { throw new IllegalStateException(\"JDBC_DRIVER_SERVICE_URL is malformed: \" + baseUrl, e); }\nInetAddress.getByName(host); // fail fast on DNS","typeGuard":null,"tryCatchPattern":"try { map = db.driverMetadata(driverId); } catch (KettleDatabaseException e) { if (e.getMessage().startsWith(\"Failed to fetch driver metadata\")) { Throwable c = e.getCause(); if (c instanceof java.io.IOException) { log.warn(\"Network/IO problem: \" + c.getMessage()); retryWithBackoff(); } else if (c instanceof com.fasterxml.jackson.core.JsonProcessingException) { log.error(\"Service returned non-JSON body\"); } else throw e; } else throw e; }","preventionTips":["Validate the service URL scheme/host at startup","Add timeouts on the metadata service side so connections don't hang","Ensure the service always returns JSON with content-type application/json","Check DNS/proxy/TLS configuration between PDI and the service"],"tags":["http","json","network","jdbc","metadata"],"backgroundTag":"api-request-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"}