Can't download NZB files from newznab indexer

Sonarr version (exact version): 3.0.6.1342
Mono version (if Sonarr is not running on Windows): 5.20.1.34
OS: CentOS 7 - docker with 3.0.6.1342-ls126 by linuxserver.io
Trace log:

2021-11-03 18:03:05.6|Debug|Api|[GET] /api/v3/release?seriesId=897&seasonNumber=5: 200.OK (6463 ms)
2021-11-03 18:03:07.1|Debug|Api|[GET] /api/system/status?apikey=(removed) 200.OK (2 ms)
2021-11-03 18:03:07.1|Debug|Api|[GET] /api/system/status?apikey=(removed) 200.OK (1 ms)
2021-11-03 18:03:09.9|Debug|Sabnzbd|Downloaded nzb for episode 'Cheers.S05E18.SDTV.H265.HVEC' finished (4935 bytes from https://newznab.server/getnzb/c0b0761d3a2e116daa6897956604cd9a.nzb&i=1&r=(removed)
2021-11-03 18:03:09.9|Fatal|SonarrErrorPipeline|Request Failed. POST /api/v3/release

[v3.0.6.1342] System.Xml.XmlException: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.
  at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String[] args) [0x00029] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res, System.String[] args) [0x0000c] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.ThrowInvalidChar (System.Char[] data, System.Int32 length, System.Int32 invCharPos) [0x0000f] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace () [0x00139] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x002d4] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <bd5c041e7d1041e99a7de375201ad744>:0 
  at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00016] in <4f16f0c172a64d31b90482c79304bd7f>:0 
  at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader) [0x00000] in <4f16f0c172a64d31b90482c79304bd7f>:0 
  at NzbDrone.Core.Download.NzbValidationService.Validate (System.String filename, System.Byte[] fileContent) [0x00026] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\NzbValidationService.cs:23 
  at NzbDrone.Core.Download.UsenetClientBase`1[TSettings].Download (NzbDrone.Core.Parser.Model.RemoteEpisode remoteEpisode) [0x00181] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\UsenetClientBase.cs:78 
  at NzbDrone.Core.Download.DownloadService.DownloadReport (NzbDrone.Core.Parser.Model.RemoteEpisode remoteEpisode) [0x0018f] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\DownloadService.cs:75 
  at Sonarr.Api.V3.Indexers.ReleaseModule.DownloadRelease (Sonarr.Api.V3.Indexers.ReleaseResource release) [0x001a7] in M:\BuildAgent\work\63739567f01dbcc2\src\Sonarr.Api.V3\Indexers\ReleaseModule.cs:129 
  at Sonarr.Api.V3.Indexers.ReleaseModule.<.ctor>b__10_2 (System.Object x) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\Sonarr.Api.V3\Indexers\ReleaseModule.cs:65 
  at Nancy.NancyModule+<>c__DisplayClass38_0`1[T].<Post>b__0 (System.Object args) [0x00047] in <e31b230dbd29407fadcc55713e0bbd0f>:0 
  at Nancy.NancyModule+<>c__DisplayClass40_0`1[T].<Post>b__0 (System.Object args, System.Threading.CancellationToken ct) [0x00047] in <e31b230dbd29407fadcc55713e0bbd0f>:0 
  at Nancy.Routing.Route`1[T].Invoke (Nancy.DynamicDictionary parameters, System.Threading.CancellationToken cancellationToken) [0x00017] in <e31b230dbd29407fadcc55713e0bbd0f>:0 
  at Nancy.Routing.DefaultRouteInvoker.Invoke (Nancy.Routing.Route route, System.Threading.CancellationToken cancellationToken, Nancy.DynamicDictionary parameters, Nancy.NancyContext context) [0x00086] in <e31b230dbd29407fadcc55713e0bbd0f>:0 
  at Nancy.Routing.DefaultRequestDispatcher.Dispatch (Nancy.NancyContext context, System.Threading.CancellationToken cancellationToken) [0x002b7] in <e31b230dbd29407fadcc55713e0bbd0f>:0 
  at Nancy.NancyEngine.InvokeRequestLifeCycle (Nancy.NancyContext context, System.Threading.CancellationToken cancellationToken, Nancy.Bootstrapper.IPipelines pipelines) [0x0011d] in <e31b230dbd29407fadcc55713e0bbd0f>:0 

2021-11-03 18:03:10.0|Debug|Api|[POST] /api/v3/release: 500.InternalServerError (1215 ms)

Description of issue:
I have used the API key from settings and the URL to confirm that the downloaded NZB from the URL has the same number of bytes, is valid, and adding it to sabnzbd+ does trigger a correct download. The same index is working with no issues with radarr. Happens with all downloads from this index in sonarr.

can you post the whole log? i think there might potentially be something helpful when its sending the search to the indexer.

i dont think newznab+ has many options around the api or xml but it cant hurt to go through them and see what there is and if they might potentially help.

the reason a manual download works is because its not the same as when sonarr requests the data, you get a file, sonarr gets xml data that it then needs to validate and decode, after which it builds the job data (equivalent to the nzb file) and sends that to the download client via its web API.

for whatever reason the xml data being returned by your newznab server has an invalid character in it, right at the very first character, thats screwing it up. xml is meant to be all pure text, no weird control characters (like 0x1F) are supported.

you should be able to find the url sonarr is using to request the data from your indexer in the trace logs and then do that from a web browser to check the xml yourself - im not sure but i think if you view the source any invalid control characters in there should show up, although you may need to copy/paste it into a proper editor (one that can show control characters) for them to show up.

Thanks for the prompting to look more closely at the file I’m getting from the server. Problem ended up being with my code that I hacked into newznab that stores my older nzb files on wasabi storage then fetches them dynamically when they are requested. I was not ungzipping the returned file before outputting it into the normal code stream so the file ended up being double gzipped. Apparently sabnzdb and radarr has no problem with that, but sonarr couldn’t handle it. I fixed my coding problem and tested it and it is now working with no issues.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.