{"record":{"id":"6dfbf144defc01cc","repo":"Leantime/leantime","slug":"notification-plugin-zip-seek-err","errorCode":null,"errorMessage":"notification.plugin_zip_seek_err","messagePattern":"notification\\.plugin_zip_seek_err","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"app/Domain/Plugins/Services/Plugins.php","lineNumber":743,"sourceCode":"            throw new \\Exception(__('notification.plugin_cant_remove'));\n        }\n\n        if (! mkdir($pluginDir) && ! is_dir($pluginDir)) {\n            throw new \\RuntimeException(sprintf('Directory \"%s\" was not created', $pluginDir));\n        }\n\n        $zip = new \\ZipArchive;\n\n        match ($zip->open($temporaryFile)) {\n            \\ZipArchive::ER_EXISTS => throw new \\Exception(__('notification.plugin_zip_exists')),\n            \\ZipArchive::ER_INCONS => throw new \\Exception(__('notification.plugin_zip_inconsistent')),\n            \\ZipArchive::ER_INVAL => throw new \\Exception(__('notification.plugin_zip_invalid_arg')),\n            \\ZipArchive::ER_MEMORY => throw new \\Exception(__('notification.plugin_zip_malloc')),\n            \\ZipArchive::ER_NOENT => throw new \\Exception(__('notification.plugin_zip_no_file')),\n            \\ZipArchive::ER_NOZIP => throw new \\Exception(__('notification.plugin_zip_not_zip')),\n            \\ZipArchive::ER_OPEN => throw new \\Exception(__('notification.plugin_zip_cant_open')),\n            \\ZipArchive::ER_READ => throw new \\Exception(__('notification.plugin_zip_read_err')),\n            \\ZipArchive::ER_SEEK => throw new \\Exception(__('notification.plugin_zip_seek_err')),\n            default => throw new \\Exception(__('notification.plugin_zip_unknown_err')),\n            true => null,\n        };\n\n        if (! $zip->extractTo($pluginDir)) {\n            throw new \\Exception(__('notification.plugin_zip_cant_extract'));\n        }\n\n        $zip->close();\n\n        unlink($temporaryFile);\n\n        // read the composer.json content from the plugin phar file\n        $pluginModel = $this->createPluginFromComposer($foldername, $plugin->license);\n\n        if (! $this->pluginRepository->addPlugin($pluginModel)) {\n            throw new \\Exception(__('notification_cant_add_to_db'));\n        }","sourceCodeStart":725,"sourceCodeEnd":761,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Plugins/Services/Plugins.php#L725-L761","documentation":"The match maps ZipArchive::ER_SEEK to 'Zip: Seek error'. libzip could not seek within the temp file while locating the central directory (it seeks backward from EOF). A regular file on a healthy local filesystem always supports this, so the error points at an exotic storage layer for /tmp - certain FUSE, network, or overlay mounts - or a file changed under libzip between operations.","triggerScenarios":"installMarketplacePlugin() with sys_get_temp_dir() resolving to an NFS/overlay/FUSE mount whose seek/mmap semantics are broken; the temp file being modified concurrently (another process appending/truncating) while ZipArchive parses it.","commonSituations":"/tmp mounted over network storage in virtualized hosting; exotic container storage drivers; concurrent duplicate installs racing on the same temp filename.","solutions":["Point sys_temp_dir at a local ext4/xfs volume (php.ini sys_temp_dir, or TMPDIR for the php-fpm service) and retry.","Check what /tmp actually is: mount | grep ' /tmp ' - replace network/overlay mounts with local storage.","Ensure only one install of the same plugin runs at a time.","Retry on a different host to confirm it is storage-specific."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// ensure the temp dir sits on a seekable local filesystem\n$dir = sys_get_temp_dir();\nif (str_contains(realpath($dir) ?: '', '/nfs') || is_link($dir)) {\n    $dir = '/var/tmp'; // local fallback\n    if (! is_writable($dir)) {\n        throw new RuntimeException('No local seekable temp dir available');\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep /tmp on local ext4/xfs storage, not network or exotic FUSE mounts.","Set sys_temp_dir explicitly on virtualized/shared hosting.","Serialize installs of the same plugin to avoid concurrent temp-file mutation."],"tags":["plugins","ziparchive","filesystem","nfs"],"backgroundTag":"filesystem-seek-error","analyzedSha":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}