{"record":{"id":"53b6b807a19b2c36","repo":"languagetool-org/languagetool","slug":"no-confidence-values-could-be-loaded-for-pleas","errorCode":null,"errorMessage":"No confidence values could be loaded for  -- please check there are actually files that match this pattern","messagePattern":"No confidence values could be loaded for  -- please check there are actually files that match this pattern","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/ConfidenceMapLoader.java","lineNumber":73,"sourceCode":"          continue;\n        }\n        String[] parts = line.split(\",\");\n        if (parts.length >= 2) {   // there might be more columns for better debugging, but we don't use them here\n          try {\n            float confidence = Float.parseFloat(parts[1]);\n            confMap.put(new ConfidenceKey(lang, parts[0]), confidence);\n            loadCount++;\n          } catch (NumberFormatException e) {\n            throw new RuntimeException(\"Invalid confidence float value in \" + fileName + \", expected 'RULE_ID,float_value[,...]': \" + line);\n          }\n        } else {\n          throw new RuntimeException(\"Invalid line in \" + fileName + \", expected 'RULE_ID,float_value[,...]': \" + line);\n        }\n      }\n      logger.info(\"Loaded \" + loadCount + \" mappings for \" + lang + \" from confidence map for rules from \" + fileName);\n    }\n    if (confMap.size() == 0) {\n      throw new RuntimeException(\"No confidence values could be loaded for \" + filePattern +\n        \" -- please check there are actually files that match this pattern\");\n    }\n    return confMap;\n  }\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":80,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/ConfidenceMapLoader.java#L55-L80","documentation":"After iterating all languages, if no confidence mappings were loaded at all (empty confMap), ConfidenceMapLoader.load throws a RuntimeException. This guards against silently running with no confidence adjustment because the file pattern matched no existing files.","triggerScenarios":"The 'ruleIdToConfidenceFile' pattern contains '{lang}' but no per-language files matching it exist (e.g. pattern /conf/{lang}-confidence.csv while files are named confidence-{lang}.csv), or all matching files are empty.","commonSituations":"Filename-pattern mismatch between config and deployed files; files deployed to the wrong directory; per-language files all empty.","solutions":["Check the pattern in the config matches the actual filenames and location.","Create confidence files for the languages you use, named per the pattern.","Ensure the matched files contain at least one valid 'RULE_ID,float' line.","Verify the server process has read access to the files."],"exampleFix":"// before\nruleIdToConfidenceFile=/etc/lt/conf-{lang}.csv   # no such files\n// after\nruleIdToConfidenceFile=/etc/lt/confidence-{lang}.csv  # files exist: confidence-en.csv, ...","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nif (!languages.some(l => fs.existsSync(pattern.replace('{lang}', l)))) {\n  throw new Error('No files match confidence pattern: ' + pattern);\n}","typeGuard":"function patternMatchesAnyFile(pattern, langs) {\n  return langs.some(l => fs.existsSync(pattern.replace('{lang}', l)));\n}","tryCatchPattern":"try {\n  Map<ConfidenceKey,Float> map = new ConfidenceMapLoader().load(filePattern);\n} catch (RuntimeException e) {\n  logger.error(\"No confidence files loaded: \" + e.getMessage());\n}","preventionTips":["Verify pattern and filenames match before deployment.","Ship at least one non-empty per-language confidence file.","Log resolved file names at startup to catch path drift."],"tags":["config","languagetool","startup","file-not-found"],"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-14T00:17:10.932Z"}