Radarr/Radarr · critical · ArgumentException
Quality Tag is not in the correct format!
Error message
Quality Tag is not in the correct format!
What it means
ArgumentException thrown by ParseFormatTag during migration 168 (custom format rework). It migrates legacy quality tags into the new custom-format specification model using QualityTagRegex; if a stored quality tag does not match the expected regex grammar, migration aborts. Because this runs inside a DB migration, it blocks the upgrade.
Source
Thrown at src/NzbDrone.Core/Datastore/Migration/168_custom_format_rework.cs:78
}
updated.Add(new Specification168
{
Id = row.Id,
Specifications = specs
});
}
var updateSql = "UPDATE \"CustomFormats\" SET \"Specifications\" = @Specifications WHERE \"Id\" = @Id";
conn.Execute(updateSql, updated, transaction: tran);
}
public ICustomFormatSpecification ParseFormatTag(string raw)
{
var match = QualityTagRegex.Match(raw);
if (!match.Success)
{
throw new ArgumentException("Quality Tag is not in the correct format!");
}
var result = InitializeSpecification(match);
result.Negate = match.Groups["m_n"].Success;
result.Required = match.Groups["m_re"].Success;
return result;
}
private ICustomFormatSpecification InitializeSpecification(Match match)
{
var type = match.Groups["type"].Value.ToLower();
var value = match.Groups["value"].Value.ToLower();
var isRegex = match.Groups["m_r"].Success;
switch (type)
{
case "r":View on GitHub (pinned to ca451608dc)
Solutions
- Inspect the failing tag value (add temporary logging or read the row) and correct it to the documented quality-tag grammar before re-running migration 168.
- Back up AppData, delete the offending CustomFormats row(s), and retry the upgrade.
- Stay on the Radarr version whose schema matches your data, or export profiles and re-import after a clean DB.
- File an issue with the exact tag string so the regex can be made more permissive.
Example fix
// before: legacy tag that does not match QualityTagRegex var tag = "R_5.1+"; // unexpected grammar // after: normalize to a supported tag shape before migration var tag = "R_5.1"; // or remove the legacy CustomFormats row causing the failure
Defensive patterns
Strategy: validation
Validate before calling
// pre-migration: scan legacy quality tags against the regex
var regex = new Regex(QualityTagPattern); // same pattern as migration 168
foreach (var tag in legacyTags)
if (!regex.IsMatch(tag))
throw new FormatException($"Legacy quality tag '{tag}' will fail migration 168; fix or remove it."); Type guard
static bool IsValidQualityTag(string raw, Regex re) => re.IsMatch(raw);
Try / catch
// migrations run in a transaction; on failure, fix data and re-run
try { migrator.MigrateUp(); }
catch (ArgumentException ex) when (ex.Message.Contains("Quality Tag"))
{ /* identify offending row, normalize it, retry migration */ } Prevention
- Back up AppData before major upgrades so migration 168 can be re-run after data fixes.
- Avoid hand-crafting quality tags in the legacy format.
- Audit legacy CustomFormats rows for non-standard tag strings before upgrading.
When it happens
Trigger: Migration 168 reads a legacy quality tag string from the old CustomFormats table whose format does not match QualityTagRegex (e.g. unknown prefix, malformed operator, or non-ASCII characters inserted by an old plugin/edit).
Common situations: Upgrading from a very old Radarr/Sonarr-derived install with hand-crafted quality tags; tags imported from a third-party profile; corrupted tag strings.
Related errors
- Invalid token: Was expecting a '{tokenType}' token but recei
- Unable to migrate DB from nzbdrone.db to {0}. Migrate manual
- Invalid token: Was expecting a '{tokenType}' token but recei
- Unable to restore database file from backup
- {0} with ID {1} does not exist
AI-assisted analysis of Radarr/Radarr@ca451608dc (2026-08-13).
Data as JSON: /api/errors/28d001781cb31311.
Report an issue: GitHub.