{"record":{"id":"e410fd58015d25a2","repo":"getgrav/grav","slug":"ziparchiver-archive-file-cannot-be-opened-err","errorCode":null,"errorMessage":"ZipArchiver: {archive_file} cannot be opened: {error}","messagePattern":"ZipArchiver: (.+?) cannot be opened: (.+?)","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Filesystem/ZipArchiver.php","lineNumber":357,"sourceCode":"            throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');\n        }\n\n        $zip = new ZipArchive();\n        $result = $zip->open($this->archive_file);\n        if ($result !== true) {\n            $error = 'unknown error';\n            if ($result === ZipArchive::ER_NOENT) {\n                $error = 'file does not exist';\n            } elseif ($result === ZipArchive::ER_EXISTS) {\n                $error = 'file already exists';\n            } elseif ($result === ZipArchive::ER_OPEN) {\n                $error = 'cannot open file';\n            } elseif ($result === ZipArchive::ER_READ) {\n                $error = 'read error';\n            } elseif ($result === ZipArchive::ER_SEEK) {\n                $error = 'seek error';\n            }\n            throw new InvalidArgumentException('ZipArchiver: ' . $this->archive_file . ' cannot be opened: ' . $error);\n        }\n\n        $status && $status([\n            'type' => 'message',\n            'message' => 'Adding empty folders...'\n        ]);\n\n        foreach ($folders as $folder) {\n            if ($zip->addEmptyDir($folder) === false) {\n                $status && $status([\n                    'type' => 'message',\n                    'message' => 'Warning: Could not add empty directory: ' . $folder\n                ]);\n            }\n            $status && $status([\n                'type' => 'progress',\n            ]);\n        }","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Filesystem/ZipArchiver.php#L339-L375","documentation":"Error \"ZipArchiver: {archive_file} cannot be opened: {error}\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Filesystem/ZipArchiver.php:357 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}