{"record":{"id":"52b771362fdcaafc","repo":"symfony/http-kernel","slug":"please-check-your-configuration-you-are-trying-to-use","errorCode":null,"errorMessage":"Please check your configuration. You are trying to use FileStorage with an invalid dsn \"%s\". The expected format is \"file:/path/to/the/storage/folder\".","messagePattern":"Please check your configuration\\. You are trying to use FileStorage with an invalid dsn \"(.+?)\"\\. The expected format is \"file:/path/to/the/storage/folder\"\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Profiler/FileProfilerStorage.php","lineNumber":36,"sourceCode":" */\nclass FileProfilerStorage implements ProfilerStorageInterface\n{\n    /**\n     * Folder where profiler data are stored.\n     */\n    private string $folder;\n\n    /**\n     * Constructs the file storage using a \"dsn-like\" path.\n     *\n     * Example : \"file:/path/to/the/storage/folder\"\n     *\n     * @throws \\RuntimeException\n     */\n    public function __construct(string $dsn)\n    {\n        if (!str_starts_with($dsn, 'file:')) {\n            throw new \\RuntimeException(\\sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn \"%s\". The expected format is \"file:/path/to/the/storage/folder\".', $dsn));\n        }\n        $this->folder = substr($dsn, 5);\n\n        if (!is_dir($this->folder) && !@mkdir($this->folder, 0o777, true) && !is_dir($this->folder)) {\n            throw new \\RuntimeException(\\sprintf('Unable to create the storage directory (%s).', $this->folder));\n        }\n    }\n\n    /**\n     * @param-immediately-invoked-callable $filter\n     */\n    public function find(?string $ip, ?string $url, ?int $limit, ?string $method, ?int $start = null, ?int $end = null, ?string $statusCode = null, ?\\Closure $filter = null): array\n    {\n        $file = $this->getIndexFilename();\n\n        if (!file_exists($file)) {\n            return [];\n        }","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/symfony/http-kernel/blob/aa3a39d7286a62cdfea98f0e69c651a3da6e36cf/Profiler/FileProfilerStorage.php#L18-L54","documentation":"FileProfilerStorage stores profiler data on disk and requires a DSN of the form file:/path/to/folder. The constructor validates the DSN prefix and throws this RuntimeException when it does not start with 'file:', because there is no way to derive the storage folder.","triggerScenarios":"Configuring the profiler storage DSN (framework.profiler.dsn or profiler storage service) with a wrong scheme like 'mysql:...', 'sqlite:...', a bare path, or an empty string.","commonSituations":"Copying a DSN from another storage backend (Doctrine/Redis profilers) into file storage config; default config left invalid after removing an env var; typos like 'file://relative/path' handled elsewhere.","solutions":["Set the DSN to a file: URL, e.g. '%kernel.cache_dir%/profiler' → dsn: 'file:%kernel.cache_dir%/profiler'","Check the profiler DSN env var actually resolves to a file: scheme","Ensure the folder part points to a creatable directory"],"exampleFix":"// before\nframework:\n    profiler:\n        dsn: 'sqlite:%kernel.cache_dir%/profiler.db'\n// after\nframework:\n    profiler:\n        dsn: 'file:%kernel.cache_dir%/profiler'","handlingStrategy":"validation","validationCode":"if (!str_starts_with($dsn, 'file:')) {\n    throw new \\RuntimeException(\"Profiler dsn '$dsn' invalid; expected file:/path/to/folder\");\n}\n$storage = new FileProfilerStorage($dsn);","typeGuard":null,"tryCatchPattern":"try {\n    $storage = new FileProfilerStorage($dsn);\n} catch (\\RuntimeException $e) {\n    $logger->error('Profiler storage misconfigured: '.$e->getMessage());\n    $storage = new FileProfilerStorage('file:'.$kernel->getCacheDir().'/profiler');\n}","preventionTips":["Use the file: scheme in framework.profiler.dsn","Avoid hardcoding other backends' DSNs for file storage","Document the expected env var value (FILE_PROFILER_DSN=file:...) in .env.example"],"tags":["profiler","config","symfony"],"backgroundTag":"invalid-url-format","analyzedSha":"aa3a39d7286a62cdfea98f0e69c651a3da6e36cf","analyzedAt":"2026-09-13T18:03:36.509Z","contentChangedAt":"2026-09-13T18:03:36.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}