{"record":{"id":"d82096149ce6dc34","repo":"languagetool-org/languagetool","slug":"invalid-value-for-maxcheckthreads-must-be-1","errorCode":null,"errorMessage":"Invalid value for maxCheckThreads, must be >= 1: ","messagePattern":"Invalid value for maxCheckThreads, must be >= 1: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java","lineNumber":364,"sourceCode":"        maxPort = Integer.parseInt(getOptionalProperty(props, \"maxPort\", \"0\"));\n        String url = getOptionalProperty(props, \"serverURL\", null);\n        setServerURL(url);\n        String ruleIdToConfidence = getOptionalProperty(props, \"ruleIdToConfidenceFile\", null);\n        if (ruleIdToConfidence != null) {\n          ruleIdToConfidenceFile = new File(ruleIdToConfidence);\n        }\n        String langModel = getOptionalProperty(props, \"languageModel\", null);\n        if (langModel != null && loadLangModel) {\n          setLanguageModelDirectory(langModel);\n        }\n        String fasttextModel = getOptionalProperty(props, \"fasttextModel\", null);\n        String fasttextBinary = getOptionalProperty(props, \"fasttextBinary\", null);\n        if (fasttextBinary != null && fasttextModel != null) {\n          setFasttextPaths(fasttextModel, fasttextBinary);\n        }\n        maxCheckThreads = Integer.parseInt(getOptionalProperty(props, \"maxCheckThreads\", \"10\"));\n        if (maxCheckThreads < 1) {\n          throw new IllegalArgumentException(\"Invalid value for maxCheckThreads, must be >= 1: \" + maxCheckThreads);\n        }\n        // default value 0 = use maxCheckThreads setting (for compatibility)\n        maxTextCheckerThreads = Integer.parseInt(getOptionalProperty(props, \"maxTextCheckerThreads\", \"0\"));\n        if (maxTextCheckerThreads < 0) {\n          throw new IllegalArgumentException(\"Invalid value for maxTextCheckerThreads, must be >= 1: \" + maxTextCheckerThreads);\n        }\n        textCheckerQueueSize = Integer.parseInt(getOptionalProperty(props, \"textCheckerQueueSize\", \"8\"));\n        if (textCheckerQueueSize < 0) {\n          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);","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java#L346-L382","documentation":"maxCheckThreads controls the server's check thread pool and must be at least 1. A parsed value below 1 (e.g. 0 or negative) triggers this IllegalArgumentException. The default is 10 when the property is absent.","triggerScenarios":"Setting 'maxCheckThreads=0' or a negative number in the server properties file.","commonSituations":"Attempting to 'disable' threading by setting 0 (not supported); unit confusion; leftover test values in production config.","solutions":["Set maxCheckThreads to a positive integer (e.g. 10) in the properties file","Remove the property to use the default of 10","Size the value to CPU cores; do not use 0 to limit load — use rate limiting instead"],"exampleFix":"# before\nmaxCheckThreads=0\n# after\nmaxCheckThreads=10","handlingStrategy":"validation","validationCode":"int t = Integer.parseInt(props.getProperty(\"maxCheckThreads\", \"10\"));\nif (t < 1) throw new IllegalArgumentException(\"maxCheckThreads must be >= 1, got \" + t);","typeGuard":null,"tryCatchPattern":"try { cfg = new HTTPServerConfig(props, args); } catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Invalid value for maxCheckThreads\")) { props.setProperty(\"maxCheckThreads\", \"10\"); cfg = new HTTPServerConfig(props, args); } else throw e;\n}","preventionTips":["Never set thread-pool sizes to 0 to 'disable' them; remove the key instead","Size threads to available CPUs and load-test the value","Add numeric-bound assertions to config parsing tests"],"tags":["configuration","threading","validation","java"],"backgroundTag":"invalid-config-value","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"}