prestodb/presto · error · UnsupportedOperationException

Cannot install coordinator plugins on router

Error message

Cannot install coordinator plugins on router

What it means

The router's PluginManager implementation explicitly rejects installCoordinatorPlugin by throwing UnsupportedOperationException, because the Presto router hosts only router plugins and has no coordinator plugin machinery.

Source

Thrown at presto-router/src/main/java/com/facebook/presto/router/RouterPluginManager.java:140

            implements PluginInstaller
    {
        private final RouterPluginManager pluginManager;

        public RouterPluginInstaller(RouterPluginManager pluginManager)
        {
            this.pluginManager = pluginManager;
        }

        @Override
        public void installPlugin(Plugin plugin)
        {
            pluginManager.installPlugin(plugin);
        }

        @Override
        public void installCoordinatorPlugin(CoordinatorPlugin plugin)
        {
            throw new UnsupportedOperationException("Cannot install coordinator plugins on router");
        }

        @Override
        public void installRouterPlugin(RouterPlugin plugin)
        {
            pluginManager.installRouterPlugin(plugin);
        }
    }

    private List<PluginManagerUtil.PluginClassLoaderHandle> createPluginClassLoaders()
    {
        try {
            return PluginManagerUtil.buildClassLoaders(
                    installedPluginsDir,
                    plugins,
                    resolver,
                    SPI_PACKAGES,
                    null,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use installRouterPlugin (or pluginManager.installRouterPlugin) for plugins on the router
  2. Only install coordinator plugins on a coordinator process, not the router
  3. Branch on process role before installing plugins

Example fix

// before
pluginManager.installCoordinatorPlugin(coordPlugin);
// after
pluginManager.installRouterPlugin(routerPlugin); // on the router
Defensive patterns

Strategy: type-guard

Validate before calling

if (pluginManager instanceof RouterPluginManager) {
    throw new IllegalArgumentException("Use installRouterPlugin on the router");
}

Type guard

boolean supportsCoordinatorPlugins(PluginManager pm) {
    return !(pm instanceof RouterPluginManager);
}

Try / catch

try { pluginManager.installCoordinatorPlugin(plugin); } catch (UnsupportedOperationException e) {
    log.warn("Coordinator plugin not supported here; falling back to router plugin install");
    pluginManager.installRouterPlugin(toRouterPlugin(plugin));
}

Prevention

When it happens

Trigger: Calling RouterPluginManager.installCoordinatorPlugin with any CoordinatorPlugin instance — e.g. code that installs plugins generically on a router process assuming coordinator semantics.

Common situations: Reusing coordinator bootstrap/plugin installation code paths on a router deployment; tooling that installs all plugin kinds indiscriminately.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/4b239289d51eb435. Report an issue: GitHub.