{"record":{"id":"8edc029fc5e57e89","repo":"Sonarr/Sonarr","slug":"failed-to-add-nzb-task-to-download-station","errorCode":null,"errorMessage":"Failed to add NZB task to Download Station","messagePattern":"Failed to add NZB task to Download Station","errorType":"exception","errorClass":"DownloadClientException","httpStatus":null,"severity":"error","filePath":"src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs","lineNumber":195,"sourceCode":"        protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContent)\n        {\n            var hashedSerialNumber = _serialNumberProvider.GetSerialNumber(Settings);\n\n            DsTaskProxy.AddTaskFromData(fileContent, filename, GetDownloadDirectory(), Settings);\n\n            var items = GetTasks().Where(t => t.Additional.Detail[\"uri\"] == filename);\n\n            var item = items.SingleOrDefault();\n\n            if (item != null)\n            {\n                _logger.Debug(\"{0} added correctly\", remoteEpisode);\n                return CreateDownloadId(item.Id, hashedSerialNumber);\n            }\n\n            _logger.Debug(\"No such task {0} in Download Station\", filename);\n\n            throw new DownloadClientException(\"Failed to add NZB task to Download Station\");\n        }\n\n        protected override void Test(List<ValidationFailure> failures)\n        {\n            failures.AddIfNotNull(TestConnection());\n            if (failures.HasErrors())\n            {\n                return;\n            }\n\n            failures.AddIfNotNull(TestOutputPath());\n            failures.AddIfNotNull(TestGetNZB());\n        }\n\n        protected ValidationFailure TestOutputPath()\n        {\n            try\n            {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/Sonarr/Sonarr/blob/da2284d7eaab22ed9b2ca698af690148d691e967/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs#L177-L213","documentation":"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.","triggerScenarios":"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.","commonSituations":"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'.","solutions":["Open DownloadStation and check whether the NZB task exists; if yes, the uri-match logic in Sonarr cannot pair it.","Re-grab the NZB from Sonarr and confirm the task appears in DownloadStation.","Avoid duplicate NZB submissions with the same filename.","Inspect DownloadStation logs for any task-creation failure on the NZB endpoint."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return AddFromNzbFileCore(remoteEpisode, filename, fileContent); }\ncatch (DownloadClientException ex) when (ex.Message.Contains(\"Failed to add NZB task\"))\n{\n    _logger.Warn(ex, \"NZB task not found immediately; retrying once.\");\n    return AddFromNzbFileCore(remoteEpisode, filename, fileContent);\n}","preventionTips":["Confirm the NZB was added in DownloadStation before declaring failure.","Avoid duplicate NZB filenames that break SingleOrDefault.","Inspect DownloadStation logs for NZB parse errors that prevent task registration."],"tags":["downloadstation","synology","nzb","task","download-client"],"backgroundTag":null,"analyzedSha":"da2284d7eaab22ed9b2ca698af690148d691e967","analyzedAt":"2026-08-13T15:53:02.562Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}