{"record":{"id":"fb1c02974afa4c2a","repo":"languagetool-org/languagetool","slug":"remote-rules-configuration-file-cannot-be-found","errorCode":null,"errorMessage":"Remote rules configuration file cannot be found: ","messagePattern":"Remote rules configuration file cannot be found: ","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java","lineNumber":391,"sourceCode":"          throw new IllegalArgumentException(\"Invalid value for textCheckerQueueSize, must be >= 1: \" + textCheckerQueueSize);\n        }\n\n        boolean atdMode = getOptionalProperty(props, \"mode\", \"LanguageTool\").equalsIgnoreCase(\"AfterTheDeadline\");\n        if (atdMode) {\n          throw new IllegalArgumentException(\"The AfterTheDeadline mode is not supported anymore in LanguageTool 3.8 or later\");\n        }\n        String rulesConfigFilePath = getOptionalProperty(props, \"rulesFile\", null);\n        if (rulesConfigFilePath != null) {\n          rulesConfigFile = new File(rulesConfigFilePath);\n          if (!rulesConfigFile.exists() || !rulesConfigFile.isFile()) {\n            throw new RuntimeException(\"Rules Configuration file cannot be found: \" + rulesConfigFile);\n          }\n        }\n        String remoteRulesConfigFilePath = getOptionalProperty(props, \"remoteRulesFile\", null);\n        if (remoteRulesConfigFilePath != null) {\n          remoteRulesConfigFile = new File(remoteRulesConfigFilePath);\n          if (!remoteRulesConfigFile.exists() || !remoteRulesConfigFile.isFile()) {\n            throw new RuntimeException(\"Remote rules configuration file cannot be found: \" + remoteRulesConfigFile);\n          }\n        }\n        cacheSize = Integer.parseInt(getOptionalProperty(props, \"cacheSize\", \"0\"));\n        if (cacheSize < 0) {\n          throw new IllegalArgumentException(\"Invalid value for cacheSize: \" + cacheSize + \", use 0 to deactivate cache\");\n        }\n        if (props.containsKey(\"cacheTTLSeconds\") && !props.containsKey(\"cacheSize\")) {\n          throw new IllegalArgumentException(\"Use of cacheTTLSeconds without also setting cacheSize has no effect.\");\n        }\n        cacheTTLSeconds = Integer.parseInt(getOptionalProperty(props, \"cacheTTLSeconds\", \"300\"));\n        maxErrorsPerWordRate = Float.parseFloat(getOptionalProperty(props, \"maxErrorsPerWordRate\", \"0\"));\n        suggestionsEnabled = Boolean.parseBoolean(getOptionalProperty(props, \"suggestionsEnabled\", \"true\"));\n        maxSpellingSuggestions = Integer.parseInt(getOptionalProperty(props, \"maxSpellingSuggestions\", \"0\"));\n        blockedReferrers = Arrays.asList(getOptionalProperty(props, \"blockedReferrers\", \"\").split(\",\\\\s*\"));\n        setTrustedSources(getOptionalProperty(props, \"trustedSources\", null));\n        String premiumAlwaysValue = props.getProperty(\"premiumAlways\");\n        if (premiumAlwaysValue != null) {\n          premiumAlways = Boolean.parseBoolean(premiumAlwaysValue.trim());","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java#L373-L409","documentation":"The 'remoteRulesFile' property points to a configuration file for remote rules (e.g. remotely managed rule settings). When the configured path does not exist or is not a regular file, HTTPServerConfig throws this RuntimeException at startup because remote rule configuration cannot be loaded.","triggerScenarios":"Starting the HTTP server with 'remoteRulesFile=/path' where the path is missing, is a directory, or the file was not synced to the machine/container running the server.","commonSituations":"Config copied between servers without copying the remote rules file; path valid on the admin workstation but not on the server; directory passed instead of file; permission staging scripts failed silently.","solutions":["Correct the 'remoteRulesFile' property to point at an existing regular file (absolute path recommended)","Check file existence with 'ls -l <path>' and fix permissions if unreadable","Remove the 'remoteRulesFile' property if remote rules are not used"],"exampleFix":"// before (server.properties)\nremoteRulesFile=/etc/languagetool/remote-rules.conf\n\n// after: file deployed first, or property removed\n# remoteRulesFile removed (not using remote rules)","handlingStrategy":"validation","validationCode":"String p = props.getProperty(\"remoteRulesFile\");\nif (p != null && !new File(p).isFile()) {\n    throw new IllegalStateException(\"remoteRulesFile missing or not a regular file: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    serverConfig = new HTTPServerConfig(props);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Remote rules configuration file cannot be found\")) {\n        log.error(\"remoteRulesFile path invalid: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Ship the remote rules file together with the config file in the same deployment artifact","Use absolute paths and verify file presence in the container entrypoint before launch","Remove remoteRulesFile when the feature is unused"],"tags":["java","languagetool","file-not-found","server-config"],"backgroundTag":"file-not-found","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}