{"record":{"id":"6c28932d624e7a2c","repo":"languagetool-org/languagetool","slug":"no-rules-are-active-please-make-sure-your-rule-id","errorCode":null,"errorMessage":"No rules are active. Please make sure your rule ids (<options.getEnabledRules()>) and category ids (<catIds>) are correct","messagePattern":"No rules are active\\. Please make sure your rule ids \\(<options\\.getEnabledRules\\(\\)>\\) and category ids \\(<catIds>\\) are correct","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-commandline/src/main/java/org/languagetool/commandline/Main.java","lineNumber":434,"sourceCode":"        System.err.println(\"No language specified, using English (no spell checking active, \" +\n                \"specify a language variant like 'en-GB' if available)\");\n      }\n      options.setLanguage(new English());\n    } else if (!options.isApplySuggestions()) {\n      languageHint = \"Expected text language: \" + options.getLanguage().getName();\n    }\n    options.getLanguage().getSentenceTokenizer().setSingleLineBreaksMarksParagraph(\n            options.isSingleLineBreakMarksParagraph());\n    Main prg = new Main(options);\n    if (options.getFalseFriendFile() != null) {\n      List<AbstractPatternRule> ffRules = prg.lt.loadFalseFriendRules(options.getFalseFriendFile());\n      for (AbstractPatternRule ffRule : ffRules) {\n        prg.lt.addRule(ffRule);\n      }\n    }\n    if (prg.lt.getAllActiveRules().isEmpty()) {\n      List<String> catIds = options.getEnabledCategories().stream().map(i -> i.toString()).collect(Collectors.toList());\n      throw new RuntimeException(\"No rules are active. Please make sure your rule ids \" +\n              \"(\" + options.getEnabledRules() + \") and \" +\n              \"category ids (\" + catIds + \") are correct\");\n    }\n    if (languageHint != null) {\n      String spellHint = \"\";\n      if (!prg.isSpellCheckingActive()) {\n        if (prg.lt.getLanguage().isVariant()) {\n          spellHint = \" (no spell checking active)\";\n        } else {\n          spellHint = \" (no spell checking active, specify a language variant like 'en-GB' if available)\";\n        }\n      }\n      System.err.println(languageHint + spellHint);\n    }\n    prg.setListUnknownWords(options.isListUnknown());\n    if (options.isProfile()) {\n      prg.setProfilingMode();\n    }","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-commandline/src/main/java/org/languagetool/commandline/Main.java#L416-L452","documentation":"After building the JLanguageTool instance and applying enabled/disabled rules, main() checks that at least one rule is active. If getAllActiveRules() is empty it throws with this message listing the enabled rule ids and category ids. It guards against running with a configuration that would check nothing.","triggerScenarios":"Passing --enable ids (rules or categories via --enablecategories-equivalent options) that match no rules of the selected language, or disabling everything so no active rules remain.","commonSituations":"Typo in a rule id (case-sensitive); enabling a rule that belongs to a different language; enabling only rules hidden behind a premium/remote configuration; disabling all default categories.","solutions":["Print available rules with `languagetool -l <lang> --list` and match ids exactly (case-sensitive).","Remove the --enable values to fall back to the language's default active rules.","Verify category ids as well as rule ids; a wrong category with rules can also yield an empty set.","Check you are not simultaneously disabling the rules you enabled (--disable overrides)."],"exampleFix":"// before\nlanguagetool -l de --enable EN_A_VS_AN file.txt\n// after\nlanguagetool -l en-US --enable EN_A_VS_AN file.txt","handlingStrategy":"validation","validationCode":"Language lang = Languages.getLanguageForShortCode(\"en-US\");\ntry (JLanguageTool lt = new JLanguageTool(lang)) {\n  Tools.selectRules(lt, disabled, enabled, true);\n  if (lt.getAllActiveRules().isEmpty()) {\n    throw new IllegalStateException(\"Configuration enables no rules for \" + lang);\n  }\n}","typeGuard":null,"tryCatchPattern":"if (lt.getAllActiveRules().isEmpty()) {\n  System.err.println(\"No active rules; check --enable ids against 'languagetool --list'\");\n  System.exit(2);\n}","preventionTips":["Copy rule ids exactly from --list output (case-sensitive).","Don't pair --enable of one language's rules with another language.","Remember --disable overrides --enable on the same rule."],"tags":["cli","rules","configuration","validation"],"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-14T00:17:10.932Z"}