{"record":{"id":"261d8bd04ca6204d","repo":"octobercms/october","slug":"the-zip-archive-does-not-contain-a-data-file-data","errorCode":null,"errorMessage":"The ZIP archive does not contain a data file (data.json or data.csv)","messagePattern":"The ZIP archive does not contain a data file \\(data\\.json or data\\.csv\\)","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/models/importmodel/DecodesZip.php","lineNumber":73,"sourceCode":"            $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\n        if (!$dataFile) {\n            foreach (File::files($extractPath) as $file) {\n                if (in_array(strtolower(File::extension($file)), ['json', 'csv'])) {\n                    $dataFile = $file;\n                    break;\n                }\n            }\n        }\n\n        if (!$dataFile) {\n            throw new ApplicationException(__(\"The ZIP archive does not contain a data file (data.json or data.csv)\"));\n        }\n\n        // Auto-detect file format from the data file\n        if (str_ends_with($dataFile, '.json')) {\n            $this->file_format = 'json';\n        }\n        elseif (str_ends_with($dataFile, '.csv')) {\n            $this->file_format = 'csv';\n        }\n\n        return $this->importDataFilePath = $dataFile;\n    }\n\n    /**\n     * getImportFilesPath returns the directory path containing extracted\n     * files from a ZIP import, or null if not a ZIP import\n     */\n    public function getImportFilesPath()","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/importmodel/DecodesZip.php#L55-L91","documentation":"Error \"The ZIP archive does not contain a data file (data.json or data.csv)\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/models/importmodel/DecodesZip.php:73 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"}