{"record":{"id":"5baa282d488129d7","repo":"octobercms/october","slug":"failed-to-open-the-zip-archive","errorCode":null,"errorMessage":"Failed to open the ZIP archive","messagePattern":"Failed to open the ZIP archive","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/models/importmodel/DecodesZip.php","lineNumber":44,"sourceCode":"     */\n    protected $pathPrefix;\n\n    /**\n     * extractImportZip extracts a ZIP archive and returns the path to the\n     * data file inside. Also sets importFilesPath for file attachment resolution.\n     */\n    protected function extractImportZip($zipPath)\n    {\n        // Return cached result if already extracted\n        if ($this->importDataFilePath !== null) {\n            return $this->importDataFilePath;\n        }\n\n        $extractPath = temp_path('import/' . uniqid('oc'));\n\n        $zip = new \\ZipArchive;\n        if ($zip->open($zipPath) !== true) {\n            throw new ApplicationException(__(\"Failed to open the ZIP archive\"));\n        }\n\n        $zip->extractTo($extractPath);\n        $zip->close();\n\n        $this->importFilesPath = $extractPath;\n\n        // Look for data file in the ZIP root\n        $dataFile = null;\n        foreach (['data.json', 'data.csv'] as $candidate) {\n            $candidatePath = $extractPath . '/' . $candidate;\n            if (file_exists($candidatePath)) {\n                $dataFile = $candidatePath;\n                break;\n            }\n        }\n\n        // Fallback: find any JSON or CSV file in the root","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/importmodel/DecodesZip.php#L26-L62","documentation":"Error \"Failed to open the ZIP archive\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/models/importmodel/DecodesZip.php:44 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"}