{"record":{"id":"4d166fceafaf4654","repo":"prestodb/presto","slug":"unable-to-load-properties-from-config-file","errorCode":null,"errorMessage":"Unable to load properties from config file","messagePattern":"Unable to load properties from config file","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"presto-router/src/main/java/com/facebook/presto/router/scheduler/CustomSchedulerManager.java","lineNumber":86,"sourceCode":"        }\n        this.configFile = configFile;\n    }\n\n    public void addSchedulerFactory(SchedulerFactory factory)\n    {\n        checkArgument(factories.putIfAbsent(factory.getName(), factory) == null,\n                \"Presto Router Scheduler '%s' is already registered\", factory.getName());\n    }\n\n    public void loadScheduler()\n    {\n        File configFileLocation = configFile.getAbsoluteFile();\n        Map<String, String> properties;\n        try {\n            properties = new HashMap<>(loadProperties(configFileLocation));\n        }\n        catch (IOException e) {\n            throw new RuntimeException(\"Unable to load properties from config file\", e);\n        }\n\n        String name = properties.remove(NAME_PROPERTY);\n        checkArgument(!isNullOrEmpty(name),\n                \"Router scheduler configuration %s does not contain %s\", configFileLocation, NAME_PROPERTY);\n\n        log.info(\"-- Loading Presto Router Scheduler %s --\", name);\n        SchedulerFactory factory = factories.get(name);\n        checkState(factory != null, \"Presto Router Scheduler %s is not registered\", name);\n        this.scheduler = factory.create(ImmutableMap.copyOf(properties));\n        log.info(\"-- Loaded Presto Router Scheduler %s --\", name);\n    }\n\n    public Scheduler getScheduler()\n    {\n        checkState(scheduler != null, \"scheduler was not loaded\");\n        return scheduler;\n    }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-router/src/main/java/com/facebook/presto/router/scheduler/CustomSchedulerManager.java#L68-L104","documentation":"The router's CustomSchedulerManager cannot read the scheduler configuration file into a Properties map. loadScheduler loads the custom scheduler plugin's config file; if loadProperties throws IOException (missing file, unreadable permissions, directory instead of file), it is wrapped in this RuntimeException. The scheduler cannot be initialized without these properties.","triggerScenarios":"Calling CustomSchedulerManager.loadScheduler() (via SchedulerFactory.create for CUSTOM_PLUGIN_SCHEDULER type) when the configured scheduler config file path does not exist, is a directory, or is not readable by the router process.","commonSituations":"Wrong 'router.scheduler.custom.<name>.config-path' in router properties; file deleted or mounted after router start; incorrect filesystem permissions for the router user; relative path resolved against an unexpected working directory.","solutions":["Verify the scheduler config file path configured in router properties exists and is readable by the router process (use an absolute path)","Fix file permissions (chmod/chown) or recreate the missing config file","Start the router from a working directory where the relative config path resolves, or change to an absolute path"],"exampleFix":"// before (router properties)\nrouter.scheduler.custom.my-scheduler.config-path=scheduler.properties\n// after\nrouter.scheduler.custom.my-scheduler.config-path=/etc/presto/router/scheduler.properties","handlingStrategy":"try-catch","validationCode":"File cfg = new File(configPath);\nif (!cfg.isFile()) throw new IllegalStateException(\"Scheduler config missing: \" + cfg.getAbsolutePath());\nif (!cfg.canRead()) throw new IllegalStateException(\"Scheduler config not readable: \" + cfg.getAbsolutePath());","typeGuard":null,"tryCatchPattern":"try {\n    schedulerManager.loadScheduler();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Unable to load properties\")) {\n        LOG.error(\"Check scheduler config path/permissions: %s\", e.getCause());\n    }\n    throw e;\n}","preventionTips":["Use absolute paths for scheduler config files","Ensure the router process user has read permission on the config file","Mount/ship config files before the router starts and verify with a health check","Keep config files on stable storage, not temp dirs"],"tags":["router","scheduler","config","io"],"backgroundTag":"config-file-not-found","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"}