Radarr/Radarr · error · IndexerException
Indexer API call returned an unexpected StatusCode [{0}]
Error message
Indexer API call returned an unexpected StatusCode [{0}] What it means
TorrentPotatoParser.ParseResponse throws an IndexerException when the TorrentPotato indexer's HTTP status is anything other than 200 OK. The switch falls into the default branch and, finding the status is not OK, aborts before attempting to deserialize the JSON into a TorrentPotatoResponse.
Source
Thrown at src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs:24
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers.TorrentPotato
{
public class TorrentPotatoParser : IParseIndexerResponse
{
private static readonly Regex RegexGuid = new Regex(@"^magnet:\?xt=urn:btih:([a-f0-9]+)", RegexOptions.Compiled);
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
{
var results = new List<ReleaseInfo>();
switch (indexerResponse.HttpResponse.StatusCode)
{
default:
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
{
throw new IndexerException(indexerResponse, "Indexer API call returned an unexpected StatusCode [{0}]", indexerResponse.HttpResponse.StatusCode);
}
break;
}
var jsonResponse = new HttpResponse<TorrentPotatoResponse>(indexerResponse.HttpResponse);
foreach (var torrent in jsonResponse.Resource.results)
{
var torrentInfo = new TorrentInfo();
torrentInfo.Guid = GetGuid(torrent);
torrentInfo.Title = torrent.release_name;
torrentInfo.Size = (long)torrent.size * 1000 * 1000;
torrentInfo.DownloadUrl = torrent.download_url;
torrentInfo.InfoUrl = torrent.details_url;
torrentInfo.PublishDate = torrent.publish_date.ToUniversalTime();
torrentInfo.Seeders = torrent.seeders;View on GitHub (pinned to ca451608dc)
Solutions
- Read IndexerException.Response.HttpResponse.StatusCode to identify the specific non-200 status.
- 401/403/404: correct the Jackett BaseUrl and TorrentPotato path and verify the API key in indexer settings.
- 5xx/502: confirm Jackett is running and reachable, then retry.
- 429: lower the sync interval / raise the indexer rate-limit cooldown.
- Open the Jackett URL in a browser to confirm it serves the TorrentPotato endpoint for your indexer.
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate Jackett/TorrentPotato reachability before parsing
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
logger.Warn("TorrentPotato endpoint returned {0}; check Jackett URL/key.",
indexerResponse.HttpResponse.StatusCode); Type guard
null
Try / catch
try { var releases = parser.ParseResponse(indexerResponse); }
catch (IndexerException ex)
{
var code = ex.Response.HttpResponse.StatusCode;
if (code == HttpStatusCode.Unauthorized || code == HttpStatusCode.Forbidden) logger.Error("Bad TorrentPotato key/URL");
throw;
} Prevention
- Keep Jackett URL and TorrentPotato path correct
- Keep the Jackett API key current
- Confirm Jackett is running before syncing
When it happens
Trigger: A TorrentPotato-compatible indexer (e.g. Jackett's TorrentPotato endpoint) returns 401/403 for a bad passkey, 404 if the path is wrong, 429 under load, or any 5xx during Jackett downtime.
Common situations: The Jackett URL or TorrentPotato path is misconfigured; the Jackett API key/passkey is wrong or expired; Jackett is restarting or down; a reverse proxy in front of Jackett returns a non-200 (e.g. 502 from a stale upstream).
Related errors
- Unexpected response status {indexerResponse.HttpResponse.Sta
- Indexer API call resulted in an unexpected StatusCode [{0}]
- Unexpected response header {indexerResponse.HttpResponse.Hea
- Indexer responded with html content. Site is likely blocked
- Unable to parse size from: {0}
AI-assisted analysis of Radarr/Radarr@ca451608dc (2026-08-13).
Data as JSON: /api/errors/d8e69f0fe8d0c7ac.
Report an issue: GitHub.