{"record":{"id":"6d03423ea9b9c538","repo":"alibaba/druid","slug":"cannot-load-remote-config-file-from-the-config-fi","errorCode":null,"errorMessage":"Cannot load remote config file from the [config.file={configFile}].","messagePattern":"Cannot load remote config file from the \\[config\\.file=(.+?)\\]\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/druid/filter/config/ConfigFilter.java","lineNumber":168,"sourceCode":"        return Boolean.valueOf(decrypterId);\n    }\n\n    Properties loadPropertyFromConfigFile(Properties connectionProperties) {\n        String configFile = connectionProperties.getProperty(CONFIG_FILE);\n\n        if (configFile == null) {\n            configFile = System.getProperty(SYS_PROP_CONFIG_FILE);\n        }\n\n        if (configFile != null && configFile.length() > 0) {\n            if (LOG.isInfoEnabled()) {\n                LOG.info(\"DruidDataSource Config File load from : \" + configFile);\n            }\n\n            Properties info = loadConfig(configFile);\n\n            if (info == null) {\n                throw new IllegalArgumentException(\n                        \"Cannot load remote config file from the [config.file=\" + configFile + \"].\");\n            }\n\n            return info;\n        }\n\n        return null;\n    }\n\n    public void decrypt(DruidDataSource dataSource, Properties info) {\n        try {\n            String encryptedPassword = null;\n            if (info != null) {\n                encryptedPassword = info.getProperty(DruidDataSourceFactory.PROP_PASSWORD);\n            }\n\n            if (encryptedPassword == null || encryptedPassword.length() == 0) {\n                encryptedPassword = dataSource.getConnectProperties().getProperty(DruidDataSourceFactory.PROP_PASSWORD);","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/alibaba/druid/blob/fa8dc9912637a2f729eef9f55356621fec18d40e/core/src/main/java/com/alibaba/druid/filter/config/ConfigFilter.java#L150-L186","documentation":"loadPropertyFromConfigFile throws this when a config.file (or druid.config.file system property) was supplied and non-empty, but loadConfig(configFile) returned null. loadConfig returns null only when it cannot open/read/parse the resource for any scheme (file://, http(s)://, classpath:, or bare path). So the path was set but unreachable.","triggerScenarios":"config.file is configured (connection property, system property druid.config.file) and loadConfig returns null: file does not exist / unreadable, HTTP URL returns non-200/empty body, classpath resource absent, or the content is unparseable as .properties/.xml.","commonSituations":"Wrong path in config.file; the app lacks read permission on the file; an http config endpoint is down or behind auth; classpath: resource is in a JAR that is not on the runtime classpath; a typo in the URL scheme.","solutions":["Verify the exact path/URL in config.file resolves from the JVM's working directory and classloader.","For file://, check filesystem permissions and that the path is absolute or correctly relative.","For http(s)://, curl the URL from the host and confirm a 200 with valid properties body.","For classpath:, confirm the resource is packaged in a JAR on the classpath.","Ensure the file is valid Java .properties or .xml properties format."],"exampleFix":"// before\n// ds.setConnectProperties({\"config.file\": \"http://cfgsrv/druid.conf\"}); // 404\n\n// after\n// ds.setConnectProperties({\"config.file\": \"http://cfgsrv/druid.properties\"}); // valid","handlingStrategy":"validation","validationCode":"Properties probe = new ConfigFilter().loadConfig(configFile);\nif (probe == null) throw new IllegalStateException(\"config.file unreadable: \" + configFile);\n// ensure reachable BEFORE wiring it into the datasource","typeGuard":null,"tryCatchPattern":"try {\n    ds.setFilters(\"config\"); ds.init();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Cannot load remote config file\")) {\n        // fix path/URL/scheme/permissions, then retry\n    }\n    throw e;\n}","preventionTips":["Use absolute paths or resolvable classpath: resources for config.file.","For http(s):// config, monitor the endpoint and cache locally as a fallback.","Test config.file resolution from the production host/user before deploy."],"tags":["config-filter","config-file","io","configuration"],"backgroundTag":null,"analyzedSha":"fa8dc9912637a2f729eef9f55356621fec18d40e","analyzedAt":"2026-08-14T04:55:06.789Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}