Sonarr/Sonarr · error · DownloadClientException

Failed to add NZB task to Download Station

Error message

Failed to add NZB task to Download Station

What it means

Thrown by UsenetDownloadStation.AddFromNzbFile after DsTaskProxy.AddTaskFromData returned, but GetTasks().Where(t => Additional.Detail["uri"] == filename).SingleOrDefault() found no matching NZB task. The NZB upload completed without API error, yet no matching task is visible to Sonarr.

Source

Thrown at src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs:195

        protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContent)
        {
            var hashedSerialNumber = _serialNumberProvider.GetSerialNumber(Settings);

            DsTaskProxy.AddTaskFromData(fileContent, filename, GetDownloadDirectory(), Settings);

            var items = GetTasks().Where(t => t.Additional.Detail["uri"] == filename);

            var item = items.SingleOrDefault();

            if (item != null)
            {
                _logger.Debug("{0} added correctly", remoteEpisode);
                return CreateDownloadId(item.Id, hashedSerialNumber);
            }

            _logger.Debug("No such task {0} in Download Station", filename);

            throw new DownloadClientException("Failed to add NZB task to Download Station");
        }

        protected override void Test(List<ValidationFailure> failures)
        {
            failures.AddIfNotNull(TestConnection());
            if (failures.HasErrors())
            {
                return;
            }

            failures.AddIfNotNull(TestOutputPath());
            failures.AddIfNotNull(TestGetNZB());
        }

        protected ValidationFailure TestOutputPath()
        {
            try
            {

View on GitHub (pinned to da2284d7ea)

Solutions

  1. Open DownloadStation and check whether the NZB task exists; if yes, the uri-match logic in Sonarr cannot pair it.
  2. Re-grab the NZB from Sonarr and confirm the task appears in DownloadStation.
  3. Avoid duplicate NZB submissions with the same filename.
  4. Inspect DownloadStation logs for any task-creation failure on the NZB endpoint.
Defensive patterns

Strategy: retry

Try / catch

try { return AddFromNzbFileCore(remoteEpisode, filename, fileContent); }
catch (DownloadClientException ex) when (ex.Message.Contains("Failed to add NZB task"))
{
    _logger.Warn(ex, "NZB task not found immediately; retrying once.");
    return AddFromNzbFileCore(remoteEpisode, filename, fileContent);
}

Prevention

When it happens

Trigger: AddTaskFromData(fileContent, filename, ...) completes; GetTasks filtered to NZB-type tasks where uri == filename yields nothing -> SingleOrDefault returns null -> throw. Happens when DownloadStation renames the NZB task, stores the source URL, or lists it under a different uri field.

Common situations: DownloadStation stored the task under the NZB's internal subject rather than the filename; task created then immediately errored (bad NZB) and filtered; the NZB was a duplicate of an existing task; slow registration read as 'not found'.

Related errors


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