{"record":{"id":"10a396249640833d","repo":"octobercms/october","slug":"cannot-create-file-name","errorCode":null,"errorMessage":"Cannot create file: :name","messagePattern":"Cannot create file: :name","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/CodeParser.php","lineNumber":186,"sourceCode":"        $className = $data['className'];\n\n        if (!class_exists($className)) {\n            require_once $data['filePath'];\n        }\n\n        // Handle corrupt cache during concurrent access\n        $count = 0;\n        while (!class_exists($className)) {\n            if ($count !== 0) {\n                usleep(rand(50000, 200000));\n            }\n\n            $data = $this->handleCorruptCache($data);\n            $className = $data['className'];\n\n            if ($count++ > 10) {\n                $path = $data['filePath'] ?? $this->getCacheFilePath();\n                throw new SystemException(Lang::get('system::lang.file.create_fail', ['name'=>$path]));\n            }\n        }\n\n        return new $className($page, $layout, $controller);\n    }\n\n    /**\n     * handleCorruptCache in some rare cases the cache file will not contain the class\n     * name we expect. When this happens, destroy the corrupt file,\n     * flush the request cache, and repeat the cycle.\n     * @return void\n     */\n    protected function handleCorruptCache($data)\n    {\n        $path = $data['filePath'] ?? $this->getCacheFilePath();\n\n        if (is_file($path)) {\n            if (($className = $this->extractClassFromFile($path)) && class_exists($className)) {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/CodeParser.php#L168-L204","documentation":"Error \"Cannot create file: :name\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/classes/CodeParser.php:186 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}