{"record":{"id":"b29a735ee483b7d2","repo":"DIYgod/RSSHub","slug":"this-route-is-empty-please-check-the-original-sit","errorCode":null,"errorMessage":"this route is empty, please check the original site or <a href=\"https://github.com/DIYgod/RSSHub/issues/new/choose\">create an issue</a>","messagePattern":"this route is empty, please check the original site or <a href=\"https://github\\.com/DIYgod/RSSHub/issues/new/choose\">create an issue</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"error","filePath":"lib/middleware/parameter.ts","lineNumber":72,"sourceCode":"\n    return response.choices[0].message.content;\n};\n\nconst getAuthorString = (item) => {\n    let author = '';\n    if (item.author) {\n        author = typeof item.author === 'string' ? item.author : item.author.map((i) => i.name).join(' ');\n    }\n    return author;\n};\n\nconst middleware: MiddlewareHandler = async (ctx, next) => {\n    await next();\n\n    const data = ctx.get('data') as Data;\n    if (data) {\n        if ((!data.item || data.item.length === 0) && !data.allowEmpty) {\n            throw new Error('this route is empty, please check the original site or <a href=\"https://github.com/DIYgod/RSSHub/issues/new/choose\">create an issue</a>');\n        }\n\n        // fix allowEmpty\n        data.item ||= [];\n\n        // decode HTML entities\n        data.title &&= entities.decodeXML(data.title + '');\n        data.description &&= entities.decodeXML(data.description + '');\n\n        // sort items\n        if (ctx.req.query('sorted') !== 'false') {\n            data.item = data.item.toSorted((a: DataItem, b: DataItem) => +new Date(b.pubDate || 0) - +new Date(a.pubDate || 0));\n        }\n\n        const handleItem = (item: DataItem) => {\n            item.title &&= entities.decodeXML(item.title + '');\n            item.description ||= item.content?.html;\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/middleware/parameter.ts#L54-L90","documentation":"Thrown by the parameter middleware after the route handler runs, when the assembled Data has no items (item is falsy or length 0) and the route did not opt in via data.allowEmpty. It is RSSHub's signal that a route is broken or the source genuinely has nothing, rather than silently serving an empty feed.","triggerScenarios":"The route's scraper returned [] because selectors no longer match the redesigned source site; the upstream API returned an empty list; a required query parameter was omitted so the source returns nothing; a transient empty response that is not retried.","commonSituations":"Source site ships a redesign and selectors break; upstream API changes shape; geographic/IP block returns an empty page; a previously-working feed suddenly 500s after a site change.","solutions":["Open the original site URL in a browser and confirm whether content actually exists.","If the source has content, the route scraper is likely broken — update selectors/API parsing in the route and report/fix upstream.","If an empty result is legitimate for this route, set `data.allowEmpty = true` before returning.","Check the route's required parameters are supplied correctly."],"exampleFix":"// before — route returns empty and feed 500s\nreturn { item: [] };\n// after — opt in to an intentionally empty feed\nreturn { item: [], allowEmpty: true };","handlingStrategy":"fallback","validationCode":"// Route author: validate scraped items before returning.\nif (items.length === 0 && !legitimatelyEmpty) {\n  // selectors probably broke — log and surface a clearer error\n  logger.error('No items parsed; check selectors for %s', currentUrl);\n}","typeGuard":"const isEmptyByDesign = (data: Data): boolean =>\n  Array.isArray(data.item) && data.item.length === 0 && data.allowEmpty === true;","tryCatchPattern":"// Reader/client: an 'empty route' 500 means the source is broken, not transient.\n// Do not retry aggressively; back off and alert the operator.","preventionTips":["Set data.allowEmpty only when emptiness is expected (e.g. search with no results).","Pin selectors to stable containers and add tests against saved HTML.","Log the upstream URL/status when items are empty to speed diagnosis."],"tags":["data","routes","scraping","middleware"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}