{"record":{"id":"4b50b0fce990158b","repo":"BookStackApp/BookStack","slug":"errors-import-zip-cant-read","errorCode":null,"errorMessage":"errors.import_zip_cant_read","messagePattern":"errors\\.import_zip_cant_read","errorType":"exception","errorClass":"ZipExportException","httpStatus":null,"severity":"error","filePath":"app/Exports/ZipExports/ZipExportReader.php","lineNumber":34,"sourceCode":"\n    public function __construct(\n        protected string $zipPath,\n    ) {\n        $this->zip = new ZipArchive();\n    }\n\n    /**\n     * @throws ZipExportException\n     */\n    protected function open(): void\n    {\n        if ($this->open) {\n            return;\n        }\n\n        // Validate file exists\n        if (!file_exists($this->zipPath) || !is_readable($this->zipPath)) {\n            throw new ZipExportException(trans('errors.import_zip_cant_read'));\n        }\n\n        // Validate file is valid zip\n        $opened = $this->zip->open($this->zipPath, ZipArchive::RDONLY);\n        if ($opened !== true) {\n            throw new ZipExportException(trans('errors.import_zip_cant_read'));\n        }\n\n        $this->open = true;\n    }\n\n    public function close(): void\n    {\n        if ($this->open) {\n            $this->zip->close();\n            $this->open = false;\n        }\n    }","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/BookStackApp/BookStack/blob/18f8469a1c72f8cc8497e9372635e6dea5028071/app/Exports/ZipExports/ZipExportReader.php#L16-L52","documentation":"ZipExportException raised in ZipExportReader::open when the ZIP import file does not exist or is not readable at zipPath. Input at fault: the uploaded/stored import ZIP path that is absent from disk or lacks read permission.","triggerScenarios":"Thrown at app/Exports/ZipExports/ZipExportReader.php:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-upload the import ZIP file","Check the storage path for imports is intact and readable by PHP","Verify file permissions on the ZIP file","Confirm the file was not removed by cleanup jobs before import completed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"18f8469a1c72f8cc8497e9372635e6dea5028071","analyzedAt":"2026-09-02T19:49:33.068Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}