prestodb/presto · critical · RuntimeException
Failed to build plugin classloaders
Error message
Failed to build plugin classloaders
What it means
FlightShimPluginManager.createPluginClassLoaders builds classloaders for plugin packages. Any exception while constructing those classloaders is rethrown as a RuntimeException('Failed to build plugin classloaders', e). This aborts server startup because the shim cannot isolate/load plugin SPI classes.
Source
Thrown at presto-flight-shim/src/main/java/com/facebook/presto/flightshim/FlightShimPluginManager.java:237
{
return codecTransactionHandle;
}
}
private List<PluginManagerUtil.PluginClassLoaderHandle> createPluginClassLoaders()
{
try {
return PluginManagerUtil.buildClassLoaders(
installedPluginsDir,
plugins,
resolver,
SPI_PACKAGES,
null,
SERVICES_FILE,
getClass().getClassLoader());
}
catch (Exception e) {
throw new RuntimeException("Failed to build plugin classloaders", e);
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Inspect the cause stack trace to find the failing plugin directory/jar or missing resource
- Fix file permissions and ensure the plugin directory layout is correct and jars are not corrupt
- Verify the deployment includes all required plugin jars and services files for the shim
Example fix
// before (deployment) plugin.dir=/nonexistent/path // after plugin.dir=/opt/presto-server/plugin (exists, readable, contains plugin jars)
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-flight: ensure plugin dir exists and is readable before server start
File dir = new File(pluginDir);
if (!dir.isDirectory() || !dir.canRead()) throw new IllegalStateException("Bad plugin dir: " + pluginDir); Try / catch
try { server.start(); }
catch (RuntimeException e) {
if ("Failed to build plugin classloaders".equals(e.getMessage())) {
log.fatal("Plugin classloader failure", e.getCause()); // inspect cause for IO/permission errors
}
throw e;
} Prevention
- Verify plugin directory existence, permissions, and jar integrity in deployment scripts
- Log and inspect the cause chain — the RuntimeException wraps the real IO error
- Pin plugin jar checksums to detect corruption
When it happens
Trigger: IOException/other exception while scanning plugin directories, reading services files, or creating URLClassLoader instances for SPI packages during createPluginClassLoaders.
Common situations: Missing or unreadable plugin directory; corrupt plugin jar; filesystem permission problems; classpath/resource (SERVICES_FILE) not found in the deployment layout.
Related errors
- NOT_FOUND
- Required configuration 'flight-shim.server' and 'flight-shim
- NOT_SUPPORTED
- ZOOKEEPER_ERROR
- JDBC driver class not found: {config.getJdbcDriverName()}
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/dc76b79a8c651b8a.
Report an issue: GitHub.