{"record":{"id":"79bfaa127b361f6a","repo":"languagetool-org/languagetool","slug":"invalid-value-for-maxtextcheckerthreads-must-be","errorCode":null,"errorMessage":"Invalid value for maxTextCheckerThreads, must be >= 1: ","messagePattern":"Invalid value for maxTextCheckerThreads, must be >= 1: ","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java","lineNumber":369,"sourceCode":"          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);\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);","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java#L351-L387","documentation":"maxTextCheckerThreads (added as a per-text checker pool, default 0 = inherit maxCheckThreads) must be >= 0; the message text says '>= 1' but the code enforces >= 0. Values below 0 throw this IllegalArgumentException.","triggerScenarios":"Setting 'maxTextCheckerThreads' to a negative integer (e.g. -5) in the properties file.","commonSituations":"Config typos with minus signs; copying validation guidance ('must be >= 1') and assuming 0 is invalid — 0 is actually the documented default meaning 'use maxCheckThreads'.","solutions":["Set maxTextCheckerThreads to 0 (use maxCheckThreads) or a positive integer","Remove the property to keep the default behavior","Fix any config generator emitting negative values"],"exampleFix":"# before\nmaxTextCheckerThreads=-1\n# after\nmaxTextCheckerThreads=0","handlingStrategy":"validation","validationCode":"int t = Integer.parseInt(props.getProperty(\"maxTextCheckerThreads\", \"0\"));\nif (t < 0) throw new IllegalArgumentException(\"maxTextCheckerThreads must be >= 0 (0 = use maxCheckThreads), got \" + t);","typeGuard":null,"tryCatchPattern":"try { cfg = new HTTPServerConfig(props, args); } catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"maxTextCheckerThreads\")) { props.setProperty(\"maxTextCheckerThreads\", \"0\"); cfg = new HTTPServerConfig(props, args); } else throw e;\n}","preventionTips":["Treat 0 as the valid default meaning 'inherit maxCheckThreads'","Reject negative numbers when generating config files","Keep thread/queue tuning values in one reviewed config block"],"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"}