{"record":{"id":"3b4109ad28bb5cf5","repo":"Jackett/Jackett","slug":"unexpected-response-status-indexerresponse-webre","errorCode":null,"errorMessage":"Unexpected response status '{indexerResponse.WebResponse.Status}' code from indexer request","messagePattern":"Unexpected response status '(.+?)' code from indexer request","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Jackett.Common/Indexers/Definitions/Knaben.cs","lineNumber":253,"sourceCode":"\n        private static readonly Regex _DateTimezoneRegex = new Regex(@\"[+-]\\d{2}:\\d{2}$\", RegexOptions.Compiled);\n\n        public KnabenParser(TorznabCapabilitiesCategories categories, Logger logger)\n        {\n            _categories = categories;\n            _logger = logger;\n        }\n\n        public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)\n        {\n            if (indexerResponse.WebResponse.Status != HttpStatusCode.OK)\n            {\n                if (indexerResponse.WebResponse.IsRedirect)\n                {\n                    _logger.Warn(\"Redirected to {0} from indexer request\", indexerResponse.WebResponse.RedirectingTo);\n                }\n\n                throw new Exception($\"Unexpected response status '{indexerResponse.WebResponse.Status}' code from indexer request\");\n            }\n\n            var releases = new List<ReleaseInfo>();\n\n            var jsonResponse = JsonConvert.DeserializeObject<KnabenResponse>(indexerResponse.Content);\n            _logger.Debug(jsonResponse.ToString());\n\n            if (jsonResponse?.Hits == null)\n            {\n                return releases;\n            }\n\n            var rows = jsonResponse.Hits.Where(r => r.Seeders > 0).ToList();\n\n            foreach (var row in rows)\n            {\n                // Not all entries have the TZ in the \"date\" field\n                var publishDate = row.Date.IsNotNullOrWhiteSpace() && !_DateTimezoneRegex.IsMatch(row.Date) ? $\"{row.Date}+01:00\" : row.Date;","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/Jackett/Jackett/blob/adff1941476d8057a430cf55360356c1d23e971e/src/Jackett.Common/Indexers/Definitions/Knaben.cs#L235-L271","documentation":"Thrown by KnabenParser.ParseResponse when the HTTP response status is anything other than 200 OK. Before attempting JSON deserialization, the parser checks the status code; any non-OK status (including redirects, client errors, and server errors) triggers this exception with the actual status embedded. Redirects are logged as warnings before the throw.","triggerScenarios":"The Knaben API returns a non-200 HTTP status: 429 (rate limited), 500/502/503 (server error or maintenance), 401/403 (auth required), or a 3xx redirect that was not followed.","commonSituations":"Knaben rate-limits the requesting IP; the API is under maintenance returning 503; a CDN/gateway returns 502; the endpoint was moved and returns 404; a reverse proxy returns a redirect to a new URL.","solutions":["Read the embedded status value — 429 means slow down, 5xx means server-side issue, 4xx means check auth/URL.","For 429, reduce the indexer's query interval or disable automatic refresh temporarily.","For 5xx, wait and retry — the Knaben server is likely transiently unavailable.","For 404, verify the Knaben API endpoint URL is current.","Confirm network connectivity and absence of proxy/firewall interference."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"static bool IsRetryableStatus(HttpStatusCode status)\n{\n    return status == HttpStatusCode.TooManyRequests\n        || (int)status >= 500;\n}","tryCatchPattern":"try\n{\n    var releases = indexer.GetParser().ParseResponse(indexerResponse);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"Unexpected response status\"))\n{\n    // Extract the status from the message to decide retry vs. fail\n    logger.Error(\"Knaben HTTP error: {Message}\", ex.Message);\n    if (ex.Message.Contains(\"429\") || ex.Message.Contains(\"503\"))\n    {\n        // Retry with backoff\n    }\n}","preventionTips":["Read the embedded status code — 429 means slow down, 5xx means server-side.","Reduce query frequency for 429 responses.","Retry with backoff for 5xx errors — they are typically transient.","Verify the endpoint URL for persistent 404 errors."],"tags":["http","status-code","knaben","api"],"backgroundTag":null,"analyzedSha":"adff1941476d8057a430cf55360356c1d23e971e","analyzedAt":"2026-08-13T15:06:32.872Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}