phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\InvalidCachedResultset

Cache did not return a valid resultset

Error message

Cache did not return a valid resultset

What it means

Error "Cache did not return a valid resultset" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Model/Query.zep:381

            /**
             * If the lifetime is different than the cache lifetime, assign
             * the cache lifetime to the current cache setting
             */
            let adapter       = cache->getAdapter();
            let cacheLifetime = adapter->getLifetime();

            if !fetch lifetime, cacheOptions["lifetime"] {
                let lifetime = cacheLifetime;
            }

            let result = false;
            if (cache->has(key)) {
                let result = cache->get(key);
            }

            if !empty result {
                if unlikely typeof result != "object" {
                    throw new InvalidCachedResultset();
                }

                result->setIsFresh(false);

                /**
                 * Check if only the first row must be returned
                 */
                if uniqueRow {
                    let preparedResult = result->getFirst();
                } else {
                    let preparedResult = result;
                }

                return preparedResult;
            }

            let this->cache = cache;
        }

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:381 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/3284a416d09128cd. Report an issue: GitHub.