{"record":{"id":"de1cb46e9435da58","repo":"Jackett/Jackett","slug":"http-500-internal-server-error","errorCode":null,"errorMessage":"HTTP 500 Internal Server Error","messagePattern":"HTTP 500 Internal Server Error","errorType":"exception","errorClass":"ExceptionWithConfigData","httpStatus":500,"severity":"error","filePath":"src/Jackett.Common/Indexers/Definitions/MejorTorrent.cs","lineNumber":154,"sourceCode":"        }\n\n        public override async Task<byte[]> Download(Uri link)\n        {\n            var downloadUrl = link.ToString();\n            var content = await base.Download(new Uri(downloadUrl));\n            return content;\n        }\n\n        private async Task<List<ReleaseInfo>> PerformQueryNewest(TorznabQuery query)\n        {\n            var releases = new List<ReleaseInfo>();\n            var url = SiteLink + NewTorrentsUrl;\n            var result = await RequestWithCookiesAsync(url);\n            if (result.Status != HttpStatusCode.OK)\n            {\n                if (result.Status == HttpStatusCode.InternalServerError)\n                {\n                    throw new ExceptionWithConfigData(\"HTTP 500 Internal Server Error\", configData);\n                }\n                else\n                {\n                    throw new ExceptionWithConfigData(result.ContentString, configData);\n                }\n            }\n            try\n            {\n                var searchResultParser = new HtmlParser();\n                using var doc = searchResultParser.ParseDocument(result.ContentString);\n\n                var container = doc.QuerySelector(\".gap-y-3 > div:nth-child(1) > div:nth-child(1)\");\n                var parsedDetailsLink = new List<string>();\n                string rowTitle = null;\n                string rowDetailsLink = null;\n                string rowPublishDate = null;\n                string rowQuality = null;\n","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/Jackett/Jackett/blob/adff1941476d8057a430cf55360356c1d23e971e/src/Jackett.Common/Indexers/Definitions/MejorTorrent.cs#L136-L172","documentation":"Thrown by MejorTorrent.PerformQueryNewest as an ExceptionWithConfigData when the newest-torrents page (SiteLink + NewTorrentsUrl) returns HTTP 500 Internal Server Error. The code treats 500 distinctly from other non-OK statuses because MejorTorrent frequently returns transient 500s; wrapping it in ExceptionWithConfigData signals a likely site-side/config-adjacent problem rather than a permanent failure.","triggerScenarios":"RequestWithCookiesAsync to the newest torrents URL responds with status 500. The specific branch `result.Status == HttpStatusCode.InternalServerError` matches and throws this message.","commonSituations":"MejorTorrent server overload during peak hours; backend database error on the site; a bad query/cookie triggering a server-side exception; the site is mid-deployment.","solutions":["Retry the search after a few minutes — MejorTorrent 500s are typically transient.","If it persists, open the newest torrents URL in a browser to confirm the site itself is erroring.","Reduce search frequency to avoid hammering an overloaded server.","Check the MejorTorrent status/social channels for announced downtime."],"exampleFix":"// before\nif (result.Status == HttpStatusCode.InternalServerError)\n{\n    throw new ExceptionWithConfigData(\"HTTP 500 Internal Server Error\", configData);\n}\n\n// after — retry once before surfacing, since 500s are transient\nif (result.Status == HttpStatusCode.InternalServerError)\n{\n    logger.Warn(\"MejorTorrent newest returned 500, retrying once\");\n    result = await RequestWithCookiesAsync(url);\n    if (result.Status == HttpStatusCode.InternalServerError)\n        throw new ExceptionWithConfigData(\"HTTP 500 Internal Server Error from MejorTorrent\", configData);\n}","handlingStrategy":"retry","validationCode":"// Optional pre-flight: only configure if the site is responding\nvar preflight = await RequestWithCookiesAsync(SiteLink + NewTorrentsUrl);\nif (preflight.Status == HttpStatusCode.InternalServerError)\n    logger.Warn(\"MejorTorrent is returning 500; consider deferring configuration.\");","typeGuard":null,"tryCatchPattern":"HttpResponseResult result;\nint attempts = 0;\ndo\n{\n    result = await RequestWithCookiesAsync(url);\n    if (result.Status == HttpStatusCode.InternalServerError && attempts < 1)\n        logger.Warn(\"MejorTorrent 500, retrying ({0})\", attempts);\n} while (result.Status == HttpStatusCode.InternalServerError && ++attempts < 2);\n\nif (result.Status == HttpStatusCode.InternalServerError)\n    throw new ExceptionWithConfigData(\"HTTP 500 Internal Server Error\", configData);","preventionTips":["Treat MejorTorrent 500s as transient — retry before surfacing to the user.","Avoid searching during known peak-load windows.","Reduce request frequency to lessen server load."],"tags":["network","http-500","mejortorrent","transient","server-error"],"backgroundTag":null,"analyzedSha":"adff1941476d8057a430cf55360356c1d23e971e","analyzedAt":"2026-08-13T15:06:32.872Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}