{"record":{"id":"408065b4e1a9ac1e","repo":"phalcon/cphalcon","slug":"no-route-matched-the-request-408065","errorCode":null,"errorMessage":"No route matched the request.","messagePattern":"No route matched the request\\.","errorType":"exception","errorClass":"Phalcon\\ADR\\Exceptions\\RouteNotFound","httpStatus":404,"severity":"error","filePath":"phalcon/ADR/Router/AttributeFilter.zep","lineNumber":68,"sourceCode":"\n        if !method_exists(actionClass, \"params\") {\n            return attributes;\n        }\n\n        let params = call_user_func([actionClass, \"params\"]);\n        if typeof params !== \"array\" {\n            return attributes;\n        }\n\n        for name, rule in params {\n            if isset attributes[index] {\n                let segment = attributes[index];\n\n                if isset rule[\"match\"] {\n                    let pattern = rule[\"match\"];\n\n                    if !preg_match(\"#^(?:\" . pattern . \")$#\", segment) {\n                        throw new RouteNotFound();\n                    }\n                }\n\n                let type  = isset rule[\"type\"] ? rule[\"type\"] : \"string\",\n                    value = this->cast(segment, type);\n\n                if isset rule[\"convert\"] {\n                    let convert = rule[\"convert\"],\n                        value   = call_user_func(convert, value);\n                }\n\n                let result[name] = value;\n            }\n\n            let index++;\n        }\n\n        for key, item in attributes {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/ADR/Router/AttributeFilter.zep#L50-L86","documentation":"QueryBuilderCursor requires a 'builder' config entry. The check uses fetch, so it fails both when the key is absent and when its value is null — MissingRequiredParameter('builder') is thrown at construction. The builder is the Phalcon\\Mvc\\Model\\Query\\Builder whose query the paginator slices with keyset conditions.","triggerScenarios":"new QueryBuilderCursor(['limit' => 20, 'cursorColumn' => 'id']) with no 'builder' key, or 'builder' => null (e.g. a variable that was never initialized).","commonSituations":"Conditionally created builders (null when a filter branch is skipped); copying config from examples that omit the builder; DI wiring that injects the builder under a different key name.","solutions":["Pass the builder under the exact 'builder' key: 'builder' => $builder.","Ensure the variable actually holds a builder — create it with $modelsManager->createBuilder() or new Builder([...]) before constructing the paginator.","If the builder comes from DI/factory code, verify that code path returns a Builder and not null."],"exampleFix":"// before\n$builder = $service->maybeGetBuilder(); // returns null when filters are empty\n$paginator = new QueryBuilderCursor(\n    [\n        'limit'        => 20,\n        'builder'      => $builder,\n        'cursorColumn' => 'id',\n    ]\n); // throws MissingRequiredParameter('builder')\n\n// after\n$builder = $modelsManager->createBuilder()->from(Orders::class);\n$paginator = new QueryBuilderCursor(\n    [\n        'limit'        => 20,\n        'builder'      => $builder,\n        'cursorColumn' => 'id',\n    ]\n);","handlingStrategy":"validation","validationCode":"if (!array_key_exists('builder', $config) || $config['builder'] === null) {\n    throw new \\InvalidArgumentException(\n        'QueryBuilderCursor requires a non-null \\'builder\\' entry'\n    );\n}\n// remember: the constructor uses fetch, so null is treated as missing too","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass a possibly-null builder variable; construct a default builder explicitly.","Assert the builder was actually created in DI/factory code before building the paginator."],"tags":["paginator","cursor","config","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}