SubtitleEdit/subtitleedit · error · ArgumentException
Unknown {ruleKind} rule '{id}'. Run 'seconv {listCommand}' t
Error message
Unknown {ruleKind} rule '{id}'. Run 'seconv {listCommand}' to see available IDs. What it means
Thrown by RuleIdSpec.Resolve when a token in the `--fix-common-errors-rules` or `--remove-formatting-rules` spec is not 'all' and not in the canonical availableIds set for that rule family. Matching is case-insensitive but exact-string, so misspellings, deprecated names, or IDs from the wrong family all fail. ArgumentException signals a bad option value rather than a runtime fault.
Source
Thrown at src/seconv/Core/RuleIdSpec.cs:75
if (id.Equals("all", StringComparison.OrdinalIgnoreCase))
{
if (negate)
{
selected.Clear();
}
else
{
foreach (var a in availableIds)
{
selected.Add(a);
}
}
continue;
}
if (!available.Contains(id))
{
throw new ArgumentException(
$"Unknown {ruleKind} rule '{id}'. Run 'seconv {listCommand}' to see available IDs.");
}
if (negate)
{
selected.Remove(id);
}
else
{
selected.Add(id);
}
}
return availableIds.Where(selected.Contains).ToArray();
}
}
View on GitHub (pinned to 17a9f07487)
Solutions
- Run the listed command (`seconv list-fce-rules` or `seconv list-rf-rules`) to print the exact valid IDs.
- Copy the ID verbatim from that output into your --...-rules value.
- Use 'all' or 'all,-<id>' to avoid enumerating IDs you are unsure of.
- Confirm you are using IDs from the correct family for the flag.
Example fix
# before seconv in.srt out.srt --fix-common-errors-rules=FixComas,FixHyphens # after seconv list-fce-rules # copy exact ID 'FixCommas' seconv in.srt out.srt --fix-common-errors-rules=FixCommas,FixHyphens
Defensive patterns
Strategy: validation
Validate before calling
var available = new HashSet<string>(availableIds, StringComparer.OrdinalIgnoreCase);
foreach (var tok in spec.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
{
var id = tok.TrimStart('-');
if (id.Equals("all", StringComparison.OrdinalIgnoreCase)) continue;
if (!available.Contains(id)) throw new ArgumentException("Unknown rule id: " + id);
} Type guard
static bool AreRuleIdsValid(string? spec, IReadOnlyList<string> available)
{
if (string.IsNullOrWhiteSpace(spec)) return true;
var set = new HashSet<string>(available, StringComparer.OrdinalIgnoreCase);
foreach (var tok in spec.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
{
var id = tok.TrimStart('-');
if (id.Equals("all", StringComparison.OrdinalIgnoreCase)) continue;
if (!set.Contains(id)) return false;
}
return true;
} Try / catch
try { var ids = RuleIdSpec.Resolve(spec, availableIds, kind, cmd); }
catch (ArgumentException ex) when (ex.Message.Contains("Unknown"))
{
// run the list command, surface valid IDs, reprompt
} Prevention
- Run the matching `seconv list-*-rules` command and pass IDs verbatim.
- Prefer 'all,-<id>' over enumerating IDs you are unsure of.
- Add a CI test asserting every documented ID resolves.
When it happens
Trigger: Calling `RuleIdSpec.Resolve(spec, availableIds, ruleKind, listCommand)` where `spec` contains an ID like 'FixComas' (typo of 'FixCommas') or a name from the remove-formatting family used in a fix-common-errors spec. Available IDs depend on which rule family the call passes.
Common situations: Typoing a rule ID; using a GUI display name instead of the canonical ID; stale ID from an older seconv release; mixing up the two rule families; copy-paste from a forum post with a renamed rule.
Related errors
- OCR engine '{options.OcrEngine}' is not supported. Use one o
- Translate engine '{options.TranslateEngine}' is not supporte
- Translate model '{name}' not found in {LlamaCppServerManager
- BinaryOCR database not found: {dbPath}. Use --ocr-db to poin
- nOCR database not found: {nOcrDbPath}. Use --ocr-db to point
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/cfea26e90e8fcc16.
Report an issue: GitHub.