{"record":{"id":"32a15ffea576832f","repo":"Molunerfinn/PicGo","slug":"uninstall-plugin-failed","errorCode":null,"errorMessage":"Uninstall plugin failed","messagePattern":"Uninstall plugin failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/store/plugins/actions.ts","lineNumber":244,"sourceCode":"      await pluginsAdapter.setNeedReload(true)\n\n      useAppStore.setState((state) => {\n        if (state.appConfig) {\n          state.appConfig.needReload = true\n        }\n      })\n      toast.success(i18n.t('PLUGIN_UPDATE_SUCCEED'))\n    } finally {\n      pluginStoreActions.setMutating(fullName, false)\n    }\n  },\n  async uninstallPlugin (fullName: string) {\n    pluginStoreActions.setMutating(fullName, true)\n\n    try {\n      const result = await pluginsAdapter.uninstallPlugin(fullName)\n      if (!result.success) {\n        throw new Error(result.error || 'Uninstall plugin failed')\n      }\n      await appActions.hydrateAppState()\n      const installedPlugins = await pluginsAdapter.getInstalledPlugins()\n      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))\n      await pluginsAdapter.setNeedReload(true)\n\n      useAppStore.setState((state) => {\n        if (state.appConfig) {\n          state.appConfig.needReload = true\n        }\n      })\n      toast.success(i18n.t('PLUGIN_UNINSTALL_SUCCEED'))\n    } finally {\n      pluginStoreActions.setMutating(fullName, false)\n    }\n  },\n  async savePluginConfig (\n    fullName: string,","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/store/plugins/actions.ts#L226-L262","documentation":"uninstallPlugin throws when the UNINSTALL_PLUGIN RPC via pluginsAdapter.uninstallPlugin(fullName) returns success:false, using result.error or fallback 'Uninstall plugin failed'. The catch block resets the mutating flag so the plugin stays listed if removal fails.","triggerScenarios":"npm uninstall fails in the main process: plugin already removed on disk, files locked by another process (another PicGo instance, antivirus), permission errors in the plugin directory, or handler reporting unknown fullName.","commonSituations":"Uninstalling while the plugin's uploader/transformer is actively processing an upload; two PicGo instances running against the same config dir; Windows file-locking by AV scanners; manually deleted plugin leaving stale state.","solutions":["Read result.error for the npm/handler failure detail.","Ensure no upload is running and no second PicGo instance holds the plugin directory open, then retry.","Check directory write permissions for the Electron userData/plugin path.","If the plugin is already gone, refresh the installed list to clear the stale entry.","As a last resort, close the app, delete the plugin folder manually, and restart."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"const installed = useAppStore.getState().pluginsInstalled\nif (!installed.some(p => p.fullName === fullName)) {\n  // nothing to uninstall; refresh list and return\n  pluginStoreActions.setInstalledPlugins(installed.map(mapInstalledPluginItem))\n  return\n}","typeGuard":"function isUninstallSuccess(r: { success: boolean, error?: string }): r is { success: true } {\n  return r.success === true\n}","tryCatchPattern":"try {\n  await pluginStoreActions.uninstallPlugin(fullName)\n  toast.success(i18n.t('PLUGIN_UNINSTALL_SUCCEED'))\n} catch (e) {\n  toast.error(e instanceof Error ? e.message : i18n.t('PLUGIN_UNINSTALL_FAILED'))\n  pluginStoreActions.setMutating(fullName, false)\n}","preventionTips":["Ensure no upload is in progress and no second PicGo instance is running before uninstalling.","Confirm write permissions on the plugin directory (especially on Windows with AV file locking).","Refresh the installed list after manual filesystem deletions.","Restart the app if removal keeps failing due to locked files."],"tags":["plugin","npm","rpc","filesystem"],"backgroundTag":"plugin-uninstall-failed","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}