{"record":{"id":"c5fdb45c91b11149","repo":"octobercms/october","slug":"system-lang-zip-extract-failed","errorCode":"system::lang.zip.extract_failed","errorMessage":"Unable to extract core file ':file'.","messagePattern":"Unable to extract core file ':file'\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/system/classes/updatemanager/ManagesThemes.php","lineNumber":127,"sourceCode":"\n        $this->requestServerFile('package/download', $fileCode, [\n            'type' => 'theme',\n            'name' => $name,\n            'version' => SystemHelper::VERSION\n        ]);\n    }\n\n    /**\n     * extractTheme extracts a theme after it has been downloaded.\n     */\n    public function extractTheme($name)\n    {\n        $fileCode = $name . md5($name);\n        $filePath = $this->getFilePath($fileCode);\n        $innerPath = str_replace('.', '-', strtolower($name));\n\n        if (!Zip::extract($filePath, themes_path($innerPath))) {\n            throw new ApplicationException(Lang::get('system::lang.zip.extract_failed', ['file' => $filePath]));\n        }\n\n        @unlink($filePath);\n    }\n\n    /**\n     * seedTheme seeds a theme blueprints, data and language files\n     */\n    public function seedTheme(string $name)\n    {\n        $themeName = str_replace('.', '-', strtolower($name));\n        $theme = CmsTheme::load($themeName);\n\n        if (!$theme->isValid()) {\n            throw new ApplicationException(\"Theme [$name] not found\");\n        }\n        $model = new ThemeSeed;\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/classes/updatemanager/ManagesThemes.php#L109-L145","documentation":"ManagesThemes::extractTheme() unzips a previously downloaded theme archive into themes/<lowercased-dashed-name> using Zip::extract. The archive lives at getFilePath($name . md5($name)), i.e. temp_path(md5($name . md5($name)) . '.arc'). When Zip::extract returns false, the localized message system::lang.zip.extract_failed ('Unable to extract core file \":file\".') is thrown with that archive path interpolated.","triggerScenarios":"Calling extractTheme($name) when the cached .arc archive is corrupt, truncated by an interrupted downloadTheme, or zero bytes; the ZipArchive PHP extension missing or disabled; themes_path() not writable by the PHP process; disk full; a conflicting half-extracted directory already at the target.","commonSituations":"A previous download was interrupted leaving a partial archive in the temp directory; wrong ownership/permissions on themes/ inside Docker or after a user change; a minimal PHP container without ext-zip.","solutions":["Delete the archive path named in the message (temp_path(md5($name . md5($name)) . '.arc')), re-run downloadTheme($name), then extractTheme($name)","Verify the themes/ directory is writable by the web/CLI user (chown/chmod, container user mapping)","Confirm the zip extension is loaded: php -m | grep zip, and install/enable ext-zip if missing","Check free disk space and remove any half-extracted target directory under themes/ before retrying"],"exampleFix":"// before\n$manager = UpdateManager::instance();\n$manager->extractTheme($name);\n\n// after\n$manager = UpdateManager::instance();\n$filePath = temp_path(md5($name . md5($name)) . '.arc');\nif (!is_readable($filePath) || filesize($filePath) === 0) {\n    @unlink($filePath);\n    $manager->downloadTheme($name);\n}\n$manager->extractTheme($name);","handlingStrategy":"fallback","validationCode":"$manager = \\UpdateManager::instance();\n$filePath = temp_path(md5($name . md5($name)) . '.arc');\nif (!is_readable($filePath) || filesize($filePath) === 0) {\n    @unlink($filePath);\n    $manager->downloadTheme($name);\n}\n$manager->extractTheme($name);","typeGuard":null,"tryCatchPattern":"try { $manager->extractTheme($name); } catch (\\ApplicationException $ex) { @unlink(temp_path(md5($name . md5($name)) . '.arc')); $manager->downloadTheme($name); $manager->extractTheme($name); }","preventionTips":["Verify themes_path() is writable and ext-zip is loaded before building install tooling","Treat interrupted downloads as stale: delete the .arc archive and re-download before extracting","Monitor disk space on the temp volume; partial archives are the most common cause"],"tags":["zip","theme","filesystem","permissions"],"backgroundTag":"archive-extraction-failed","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}