diff --git a/api/core/helper/marketplace.py b/api/core/helper/marketplace.py index 5402d183ed..ba891ba959 100644 --- a/api/core/helper/marketplace.py +++ b/api/core/helper/marketplace.py @@ -24,6 +24,6 @@ def batch_fetch_plugin_manifests(plugin_ids: list[str]) -> Sequence[MarketplaceP return [] url = str(URL(str(dify_config.MARKETPLACE_API_URL)) / "api/v1/plugins/batch") - response = requests.get(url, json={"plugin_ids": plugin_ids}) + response = requests.post(url, json={"plugin_ids": plugin_ids}) response.raise_for_status() return [MarketplacePluginDeclaration(**plugin) for plugin in response.json()["plugins"]] diff --git a/api/services/plugin/plugin_service.py b/api/services/plugin/plugin_service.py index 0acb53812a..2c62c7422e 100644 --- a/api/services/plugin/plugin_service.py +++ b/api/services/plugin/plugin_service.py @@ -1,3 +1,4 @@ +import logging from collections.abc import Sequence from mimetypes import guess_type @@ -11,6 +12,8 @@ from core.plugin.manager.asset import PluginAssetManager from core.plugin.manager.debugging import PluginDebuggingManager from core.plugin.manager.plugin import PluginInstallationManager +logger = logging.getLogger(__name__) + class PluginService: @staticmethod @@ -29,7 +32,14 @@ class PluginService: manager = PluginInstallationManager() plugins = manager.list_plugins(tenant_id) plugin_ids = [plugin.plugin_id for plugin in plugins if plugin.source == PluginInstallationSource.Marketplace] - manifests = {manifest.plugin_id: manifest for manifest in marketplace.batch_fetch_plugin_manifests(plugin_ids)} + try: + manifests = { + manifest.plugin_id: manifest for manifest in marketplace.batch_fetch_plugin_manifests(plugin_ids) + } + except Exception as e: + manifests = {} + logger.exception(f"failed to fetch plugin manifests: {e}") + for plugin in plugins: if plugin.source == PluginInstallationSource.Marketplace: if plugin.plugin_id in manifests: