apache/dolphinscheduler · error · RuntimeException

datasource plugin '%s' is not found

Error message

datasource plugin '%s' is not found

What it means

getPooledDataSourceClient looks up the DataSourceChannel for the given DbType from DataSourcePluginManager; when no plugin is registered for that type it throws 'datasource plugin <type> is not found' inside the pooled-client cache loader.

Source

Thrown at dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/plugin/DataSourceClientProvider.java:68

                            TimeUnit.HOURS)
                    .removalListener((RemovalListener<String, PooledDataSourceClient>) notification -> {
                        try (PooledDataSourceClient closedClient = notification.getValue()) {
                            log.info("Datasource: {} is removed from cache due to expire", notification.getKey());
                        } catch (Exception e) {
                            log.error("Close datasource client error", e);
                        }
                    })
                    .maximumSize(100)
                    .build();

    public static DataSourceClient getPooledDataSourceClient(DbType dbType,
                                                             ConnectionParam connectionParam) throws ExecutionException {
        BaseConnectionParam baseConnectionParam = (BaseConnectionParam) connectionParam;
        String datasourceUniqueId = DataSourceUtils.getDatasourceUniqueId(baseConnectionParam, dbType);
        return POOLED_DATASOURCE_CLIENT_CACHE.get(datasourceUniqueId, () -> {
            DataSourceChannel dataSourceChannel = DataSourcePluginManager.getDataSourceChannel(dbType);
            if (null == dataSourceChannel) {
                throw new RuntimeException(String.format("datasource plugin '%s' is not found", dbType.getName()));
            }
            return dataSourceChannel.createPooledDataSourceClient(baseConnectionParam, dbType);
        });
    }

    public static Connection getPooledConnection(DbType dbType,
                                                 ConnectionParam connectionParam) throws SQLException, ExecutionException {
        return getPooledDataSourceClient(dbType, connectionParam).getConnection();
    }

    public static AdHocDataSourceClient getAdHocDataSourceClient(DbType dbType, ConnectionParam connectionParam) {
        BaseConnectionParam baseConnectionParam = (BaseConnectionParam) connectionParam;
        DataSourceChannel dataSourceChannel = DataSourcePluginManager.getDataSourceChannel(dbType);
        if (null == dataSourceChannel) {
            throw new RuntimeException(String.format("datasource plugin '%s' is not found", dbType.getName()));
        }
        return dataSourceChannel.createAdHocDataSourceClient(baseConnectionParam, dbType);
    }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Deploy/install the plugin jar for the requested DbType and restart
  2. Check logs for DataSourcePluginManager load failures
  3. Confirm the DbType value matches an installed plugin
  4. Verify plugin directory configuration points to the right location

Example fix

// before
cp.getPooledConnection(DbType.DORIS, param); // no doris plugin installed
// after
// install dolphinscheduler-datasource-doris jar, restart, then retry
cp.getPooledConnection(DbType.MYSQL, param);
Defensive patterns

Strategy: try-catch

Validate before calling

DataSourceChannel ch = DataSourcePluginManager.getDataSourceChannel(dbType); if (ch == null) { /* plugin absent — deploy before connecting */ }

Try / catch

try { Connection c = DataSourceClientProvider.getPooledConnection(dbType, param); } catch (ExecutionException | RuntimeException e) { if (String.valueOf(e.getMessage()).contains("is not found")) { /* deploy plugin */ } }

Prevention

When it happens

Trigger: Requesting a pooled connection for a DbType whose plugin jar is not deployed/loaded, or a typo/unsupported dbType value.

Common situations: Deployment missing datasource plugin jars (e.g. dolphinscheduler-datasource-clickhouse not installed), custom datasource type added to enum but no plugin packaged, plugin loading failure at startup.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/d3de6ee5f1ff7693. Report an issue: GitHub.