{"record":{"id":"d3e77dac14e82036","repo":"DIYgod/RSSHub","slug":"invalid-engine-value-engine-please-check-your","errorCode":null,"errorMessage":"Invalid Engine Value: ${engine}, please check your config.","messagePattern":"Invalid Engine Value: (.+?), please check your config\\.","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"error","filePath":"lib/middleware/parameter.ts","lineNumber":194,"sourceCode":"                item.category = item.category.filter((e) => typeof e === 'string');\n            }\n            return item;\n        };\n\n        data.item = await Promise.all(data.item.map((itm) => handleItem(itm)));\n\n        // filter\n        const engine = config.feature.filter_regex_engine;\n        const makeRegex = (str: string) => {\n            // default: case_senstivie = true\n            const insensitive = ctx.req.query('filter_case_sensitive') === 'false';\n            switch (engine) {\n                case 'regexp':\n                    return new RegExp(str, insensitive ? 'i' : '');\n                case 're2':\n                    return RE2JS.compile(str, insensitive ? RE2JS.CASE_INSENSITIVE : 0);\n                default:\n                    throw new Error(`Invalid Engine Value: ${engine}, please check your config.`);\n            }\n        };\n\n        if (ctx.req.query('filter')) {\n            const regex = makeRegex(ctx.req.query('filter')!);\n\n            data.item = data.item.filter((item) => {\n                const title = item.title || '';\n                const description = item.description || title;\n                const author = getAuthorString(item);\n                const category = (item.category as string[] | undefined) || [];\n                const isFilter =\n                    regex instanceof RE2JS\n                        ? regex.matcher(title).find() || regex.matcher(description).find() || regex.matcher(author).find() || category.some((c) => regex.matcher(c).find())\n                        : title.match(regex) || description.match(regex) || author.match(regex) || category.some((c) => c.match(regex));\n\n                return isFilter;\n            });","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/middleware/parameter.ts#L176-L212","documentation":"Thrown by the filter feature in the parameter middleware when config.feature.filter_regex_engine is neither 'regexp' nor 're2'. The engine selects how the `filter` / `filterout` / `filter_title` query params are compiled; any other value (including typos, empty string, or unset-but-not-defaulted in a misconfigured build) hits the default branch.","triggerScenarios":"FILTER_REGEX_ENGINE env is set to an unsupported value (e.g. 're2js', 'pcre', 'regex', '') and a request uses any `?filter...=` query parameter, which invokes makeRegex.","commonSituations":"Operator copies a config snippet with a wrong engine name; env var left blank explicitly overrides the default; case mismatch ('RE2' vs 're2').","solutions":["Set FILTER_REGEX_ENGINE to either 'regexp' or 're2' (lowercase) and restart.","If unsure, unset the variable entirely so RSSHub applies its documented default.","Remove the `?filter` family params from the request if filtering is not needed right now."],"exampleFix":"# before\nFILTER_REGEX_ENGINE=re2js\n# after\nFILTER_REGEX_ENGINE=re2","handlingStrategy":"validation","validationCode":"const VALID_ENGINES = new Set(['regexp', 're2']);\nconst engine = process.env.FILTER_REGEX_ENGINE ?? 'regexp';\nif (!VALID_ENGINES.has(engine)) {\n  throw new Error(`FILTER_REGEX_ENGINE must be 'regexp' or 're2', got '${engine}'`);\n}","typeGuard":"const isFilterEngine = (v: unknown): v is 'regexp' | 're2' =>\n  v === 'regexp' || v === 're2';","tryCatchPattern":null,"preventionTips":["Validate FILTER_REGEX_ENGINE at deploy time in a config check step.","Avoid passing ?filter* params until the engine is confirmed valid.","Document the two valid values in your instance README."],"tags":["config","validation","middleware","regex"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}