{"record":{"id":"c8e96c04732dbaaa","repo":"prestodb/presto","slug":"runtimeexception-e","errorCode":null,"errorMessage":"RuntimeException(e)","messagePattern":"RuntimeException\\(e\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"presto-plan-checker-router-plugin/src/main/java/com/facebook/presto/router/scheduler/PlanCheckerRouterPluginSchedulerFactory.java","lineNumber":51,"sourceCode":"    {\n        return PLAN_CHECKER_ROUTER_PLUGIN;\n    }\n\n    @Override\n    public Scheduler create(Map<String, String> config)\n    {\n        try {\n            Bootstrap app = new Bootstrap(new PlanCheckerRouterPluginModule(), new MBeanModule());\n\n            Injector injector = app\n                    .doNotInitializeLogging()\n                    .setRequiredConfigurationProperties(config)\n                    .initialize();\n            return injector.getInstance(PlanCheckerRouterPluginScheduler.class);\n        }\n        catch (Exception e) {\n            throwIfUnchecked(e);\n            throw new RuntimeException(e);\n        }\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":55,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-plan-checker-router-plugin/src/main/java/com/facebook/presto/router/scheduler/PlanCheckerRouterPluginSchedulerFactory.java#L33-L55","documentation":"The scheduler factory wraps any checked exception thrown while building the Guice injector for PlanCheckerRouterPluginScheduler into an unchecked RuntimeException. It exists so the factory's create() method satisfies its signature without declaring checked exceptions; the real cause is always the wrapped exception.","triggerScenarios":"create() fails during config loading, module setup, injector.initialize(), or any checked exception inside the try block; throwIfUnchecked rethrows unchecked ones directly, checked ones get wrapped in RuntimeException(e).","commonSituations":"Bad plugin properties in the router config file; a missing/invalid required configuration property; classpath issues loading plugin modules during deployment.","solutions":["Read the caused-by chain of the RuntimeException to find the real failure","Fix the plugin configuration properties that injector.initialize() rejected","Verify the plugin JAR and its module classes are on the router's plugin classpath","Log the full stack trace rather than only the top-level RuntimeException"],"exampleFix":"// bad diagnosis\nlog.error(\"scheduler creation failed\");\n// good diagnosis\nlog.error(\"scheduler creation failed\", e); // inspect getCause() for the real config/validation error","handlingStrategy":"try-catch","validationCode":"// validate plugin config before create()\n// assert required properties exist and are parseable per PlanCheckerRouterPlugin's docs","typeGuard":null,"tryCatchPattern":"try {\n    Scheduler scheduler = factory.create(config);\n} catch (RuntimeException e) {\n    log.error(\"scheduler creation failed\", e); // inspect getCause() chain\n    throw e;\n}","preventionTips":["Always log the full stack trace including cause","Validate configuration properties before instantiating the plugin","Test plugin loading in CI with the production config file"],"tags":["presto","guice","configuration","plugin"],"backgroundTag":"plugin-initialization-failure","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}