{"record":{"id":"a6262f8fe3925098","repo":"symfony/symfony","slug":"class-not-found-a6262f","errorCode":null,"errorMessage":"Class not found: ","messagePattern":"Class not found: ","errorType":"exception","errorClass":"DomainException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php","lineNumber":94,"sourceCode":"                throw new \\RuntimeException('Failed to unserialize values, did you forget to install the \"igbinary\" extension?');\n            } elseif (null !== $value = igbinary_unserialize($value)) {\n                return $value;\n            }\n\n            throw new \\DomainException(error_get_last() ? error_get_last()['message'] : 'Failed to unserialize values.');\n        } catch (\\Error $e) {\n            throw new \\ErrorException($e->getMessage(), $e->getCode(), \\E_ERROR, $e->getFile(), $e->getLine());\n        } finally {\n            ini_set('unserialize_callback_func', $unserializeCallbackHandler);\n        }\n    }\n\n    /**\n     * @internal\n     */\n    public static function handleUnserializeCallback(string $class): never\n    {\n        throw new \\DomainException('Class not found: '.$class);\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":97,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php#L76-L97","documentation":"DefaultMarshaller::handleUnserializeCallback() is registered as unserialize_callback_func inside unmarshall(). When unserialize() encounters a class it cannot autoload, PHP calls this callback with the missing class name, which throws a DomainException. This surfaces missing-class cache corruption loudly instead of letting unserialize silently instantiate __PHP_Incomplete_Class.","triggerScenarios":"unmarshall() decodes a blob referencing a class that is not autoloadable at read time — e.g. the value's class was renamed/removed/disabled between write and read. Distinct from the adapter-level callback (error 565): this fires within the marshaller's unmarshall() path.","commonSituations":"Renaming or deleting a cached value class without clearing the cache; running a worker with fewer bundles/extensions enabled than the writer; partial deploy where classmap is out of sync; composer autoload mismatch after a refactor.","solutions":["Clear the cache pool to evict blobs referencing the old/missing class.","Restore the class (re-enable its bundle, run composer dump-autoload, fix the namespace).","Invalidate by bumping the cache namespace after any rename of cached value classes.","Keep cached value classes in stable, always-loaded namespaces."],"exampleFix":"// before — blob references App\\Legacy\\UserDTO which was moved to App\\UserDTO\n$marshaller->unmarshall($blob); // DomainException: Class not found: App\\Legacy\\UserDTO\n\n// after — flush stale blobs and/or keep the class autoloadable\n$pool->clear();\n// or bump namespace to invalidate all old entries\n$pool = new RedisAdapter($redis, 'app_v2_');","handlingStrategy":"try-catch","validationCode":"// Ensure cached value classes are autoloadable before reading\nforeach (self::CACHED_VALUE_CLASSES as $fqcn) {\n    if (!class_exists($fqcn)) {\n        throw new \\LogicException(\"Cached value class $fqcn is not autoloadable; flush cache or restore the class.\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    return $marshaller->unmarshall($blob);\n} catch (\\DomainException $e) {\n    if (str_starts_with($e->getMessage(), 'Class not found:')) {\n        $pool->deleteItem($key);\n        return $loader();\n    }\n    throw $e;\n}","preventionTips":["Keep cached value classes in stable, always-loaded namespaces.","Bump the cache namespace when renaming/removing a cached value class.","Run composer dump-autoload and align enabled bundles across all processes.","Flush shared caches after refactors that touch cached entities."],"tags":["cache","unserialize","autoloader","classmap","marshaller"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}