{"record":{"id":"0146cfaf89580e28","repo":"crater-invoice-inc/crater","slug":"zip-file-not-found","errorCode":null,"errorMessage":"Zip file not found","messagePattern":"Zip file not found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Space/ModuleInstaller.php","lineNumber":147,"sourceCode":"        $zip_file_path = $temp_dir.'/upload.zip';\n\n        // Add content to the Zip file\n        $uploaded = is_int(file_put_contents($zip_file_path, $data)) ? true : false;\n\n        if (! $uploaded) {\n            return false;\n        }\n\n        return [\n            'success' => true,\n            'path' => $zip_file_path\n        ];\n    }\n\n    public static function unzip($module, $zip_file_path)\n    {\n        if (! file_exists($zip_file_path)) {\n            throw new \\Exception('Zip file not found');\n        }\n\n        $temp_extract_dir = storage_path('app/temp2-'.md5(mt_rand()));\n\n        if (! File::isDirectory($temp_extract_dir)) {\n            File::makeDirectory($temp_extract_dir);\n        }\n        // Unzip the file\n        $zip = new ZipArchive();\n\n        if ($zip->open($zip_file_path)) {\n            $zip->extractTo($temp_extract_dir);\n        }\n\n        $zip->close();\n\n        // Delete zip file\n        File::delete($zip_file_path);","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/crater-invoice-inc/crater/blob/05d5ce26fdd8d9466009163444e944259bc0cc2a/app/Space/ModuleInstaller.php#L129-L165","documentation":"ModuleInstaller::unzip throws a generic sentinel Exception when the zip archive path passed in does not exist on disk — i.e. the earlier download/save step (file_put_contents of upload.zip) failed silently and returned false instead of a valid path.","triggerScenarios":"Thrown at app/Space/ModuleInstaller.php:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the download/save step succeeded and that it returned the zip path before calling unzip","Check storage permissions and disk space for the temp directory","Wrap the unzip call in try-catch and report 'module download failed' to the user instead of the raw exception"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"05d5ce26fdd8d9466009163444e944259bc0cc2a","analyzedAt":"2026-09-13T09:14:24.260Z","contentChangedAt":"2026-09-13T09:14:24.260Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}