{"record":{"id":"3284a416d09128cd","repo":"phalcon/cphalcon","slug":"cache-did-not-return-a-valid-resultset","errorCode":null,"errorMessage":"Cache did not return a valid resultset","messagePattern":"Cache did not return a valid resultset","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Query\\Exceptions\\InvalidCachedResultset","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":381,"sourceCode":"            /**\n             * If the lifetime is different than the cache lifetime, assign\n             * the cache lifetime to the current cache setting\n             */\n            let adapter       = cache->getAdapter();\n            let cacheLifetime = adapter->getLifetime();\n\n            if !fetch lifetime, cacheOptions[\"lifetime\"] {\n                let lifetime = cacheLifetime;\n            }\n\n            let result = false;\n            if (cache->has(key)) {\n                let result = cache->get(key);\n            }\n\n            if !empty result {\n                if unlikely typeof result != \"object\" {\n                    throw new InvalidCachedResultset();\n                }\n\n                result->setIsFresh(false);\n\n                /**\n                 * Check if only the first row must be returned\n                 */\n                if uniqueRow {\n                    let preparedResult = result->getFirst();\n                } else {\n                    let preparedResult = result;\n                }\n\n                return preparedResult;\n            }\n\n            let this->cache = cache;\n        }","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L363-L399","documentation":"Error \"Cache did not return a valid resultset\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:381 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}