{"record":{"id":"341ad06472d5fc20","repo":"getgrav/grav","slug":"ziparchiver-failed-to-write-target","errorCode":null,"errorMessage":"ZipArchiver: failed to write \"{target}\".","messagePattern":"ZipArchiver: failed to write \"(.+?)\"\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Filesystem/ZipArchiver.php","lineNumber":261,"sourceCode":"            fclose($stream);\n        }\n    }\n\n    /**\n     * Close the archive, remove everything extracted so far, and throw. Keeps a\n     * rejected archive from leaving partial output on disk.\n     *\n     * @param ZipArchive $zip\n     * @param string $destination\n     * @param string $message\n     * @return never\n     */\n    protected function abortExtraction(ZipArchive $zip, string $destination, string $message): void\n    {\n        $zip->close();\n        Folder::delete($destination);\n\n        throw new RuntimeException($message);\n    }\n\n    /**\n     * @param string $source\n     * @param callable|null $status\n     * @return $this\n     */\n    public function compress($source, ?callable $status = null)\n    {\n        if (!extension_loaded('zip')) {\n            throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');\n        }\n\n        // Get real path for our folder\n        $rootPath = realpath($source);\n        if (!$rootPath) {\n            throw new InvalidArgumentException('ZipArchiver: ' . $source . ' cannot be found...');\n        }","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Filesystem/ZipArchiver.php#L243-L279","documentation":"Error \"ZipArchiver: failed to write \"{target}\".\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Filesystem/ZipArchiver.php:261 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"}