{"record":{"id":"e24e72a0adc5ae3a","repo":"symfony/http-foundation","slug":"unsupported-redis-or-memcached-dsn-try-running-composer","errorCode":null,"errorMessage":"Unsupported Redis or Memcached DSN. Try running \"composer require symfony/cache\".","messagePattern":"Unsupported Redis or Memcached DSN\\. Try running \"composer require symfony/cache\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Session/Storage/Handler/SessionHandlerFactory.php","lineNumber":64,"sourceCode":"            case str_starts_with($connection, 'redis:'):\n            case str_starts_with($connection, 'rediss:'):\n            case str_starts_with($connection, 'valkey:'):\n            case str_starts_with($connection, 'valkeys:'):\n            case str_starts_with($connection, 'memcached:'):\n                if (!class_exists(AbstractAdapter::class)) {\n                    throw new \\InvalidArgumentException('Unsupported Redis or Memcached DSN. Try running \"composer require symfony/cache\".');\n                }\n                $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class;\n                $connection = preg_replace('/([?&])prefix=[^&]*+&?/', '\\1', $connection);\n                $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]);\n\n                return new $handlerClass($connection, array_intersect_key($options, ['prefix' => 1, 'ttl' => 1]));","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/symfony/http-foundation/blob/5aea19cd678fa4140f6108406f1096de5e9ed6e4/Session/Storage/Handler/SessionHandlerFactory.php#L46-L82","documentation":"An InvalidArgumentException thrown by SessionHandlerFactory::createHandler() when the DSN string starts with redis:, rediss:, valkey:, valkeys: or memcached: but symfony/cache (which provides AbstractAdapter used to build the client) is not installed. Like the other LogicException-style dependency guards, it reports a missing package, not a malformed DSN.","triggerScenarios":"Thrown at Session/Storage/Handler/SessionHandlerFactory.php:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run composer require symfony/cache so Redis/Memcached DSNs can be converted into connections","Create the Redis/Memcached client manually (\\Redis, Predis, \\Memcached) and pass the object to the factory instead of a DSN","Choose a different session save handler (e.g. file:// or a PDO DSN) that needs no extra package"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5aea19cd678fa4140f6108406f1096de5e9ed6e4","analyzedAt":"2026-09-13T01:52:22.855Z","contentChangedAt":"2026-09-13T01:52:22.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}