Sonarr/Sonarr · error · ResolveDownloadClientException

Download client with name '{0}' could not be found

Error message

Download client with name '{0}' could not be found

What it means

Thrown by DownloadClientProvider.ResolveDownloadClient when downloadClientName is non-blank but no definition's Name matches it case-insensitively. ResolveDownloadClientException (HTTP 400). Like error 182 this Provider method has no current production callers; the Factory method is the live path.

Source

Thrown at src/NzbDrone.Core/Download/DownloadClientProvider.cs:137

        public void ReportSuccessfulDownloadClient(DownloadProtocol downloadProtocol, int downloadClientId)
        {
            _lastUsedDownloadClient.Set(downloadProtocol.ToString(), downloadClientId);
        }

        public DownloadClientDefinition ResolveDownloadClient(int? downloadClientId, string downloadClientName)
        {
            var all = _downloadClientFactory.All();
            var clientByName = downloadClientName.IsNullOrWhiteSpace() ? null : all.FirstOrDefault(c => c.Name.EqualsIgnoreCase(downloadClientName));
            var clientById = downloadClientId.HasValue ? all.FirstOrDefault(c => c.Id == downloadClientId.Value) : null;

            if (downloadClientId.HasValue && clientById == null)
            {
                throw new ResolveDownloadClientException("Download client with ID '{0}' could not be found", downloadClientId.Value);
            }

            if (downloadClientName.IsNotNullOrWhiteSpace() && clientByName == null)
            {
                throw new ResolveDownloadClientException("Download client with name '{0}' could not be found", downloadClientName);
            }

            if (clientByName == null && clientById == null)
            {
                return null;
            }

            if (clientByName != null && clientById != null && clientByName.Id != clientById.Id)
            {
                throw new ResolveDownloadClientException("Download client with name '{0}' does not match download client with ID '{1}'", downloadClientName, downloadClientId.Value);
            }

            var client = clientById ?? clientByName;

            if (!client.Enable)
            {
                throw new ResolveDownloadClientException("Download client '{0}' ({1}) is not enabled", client.Name, downloadClientId);
            }

View on GitHub (pinned to da2284d7ea)

Solutions

  1. Correct the name to exactly match a configured client's Name (case-insensitive).
  2. Omit the name and supply the id instead.
  3. Recreate the client with the expected name.

Example fix

// before:
//   ResolveDownloadClient(null, "SABnzbd ");  // trailing space, no match

// after:
//   ResolveDownloadClient(null, "Sabnzbd");  // exact configured name
Defensive patterns

Strategy: validation

Validate before calling

if (!string.IsNullOrWhiteSpace(downloadClientName) &&
    !_downloadClientFactory.All().Any(c => c.Name.EqualsIgnoreCase(downloadClientName)))
{
    // name does not match any client: correct or drop it
    downloadClientName = null;
}

Try / catch

try { var client = provider.ResolveDownloadClient(downloadClientId, downloadClientName); }
catch (ResolveDownloadClientException ex) when (ex.Message.Contains("could not be found"))
{
    // handle: client name not found
}

Prevention

When it happens

Trigger: Calling ResolveDownloadClient(null, name) (or with a non-matching id) where name does not EqualIgnoreCase any DownloadClientDefinition.Name.

Common situations: The client was renamed or deleted; the name has a typo, extra whitespace, or different casing/spacing than the configured name; an integration stored a display name rather than the configured name.

Related errors


AI-assisted analysis of Sonarr/Sonarr@da2284d7ea (2026-08-13). Data as JSON: /api/errors/61a6778e273b1b2d. Report an issue: GitHub.