{"record":{"id":"156b1d9f91dae1f7","repo":"alibaba/nacos","slug":"airesourcestorage-plugin-is-disabled-storageke","errorCode":null,"errorMessage":"AiResourceStorage plugin is disabled:  + storageKey.getProvider()","messagePattern":"AiResourceStorage plugin is disabled:  \\+ storageKey\\.getProvider\\(\\)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"plugin/ai/src/main/java/com/alibaba/nacos/plugin/ai/storage/AiResourceStorageRouter.java","lineNumber":80,"sourceCode":"     * @return router instance\n     */\n    public static AiResourceStorageRouter getInstance() {\n        return INSTANCE;\n    }\n    \n    /**\n     * Route to storage implementation by {@link StorageKey#getProvider()}.\n     *\n     * @param storageKey storage key\n     * @return storage implementation\n     */\n    public AiResourceStorage route(StorageKey storageKey) {\n        if (storageKey == null || StringUtils.isBlank(storageKey.getProvider())) {\n            throw new IllegalArgumentException(\"StorageKey.provider is blank\");\n        }\n        if (!PluginStateCheckerHolder.isPluginEnabled(PluginType.AI_STORAGE.getType(),\n            storageKey.getProvider())) {\n            throw new IllegalStateException(\n                \"AiResourceStorage plugin is disabled: \" + storageKey.getProvider());\n        }\n        AiResourceStorage storage = STORAGES_BY_TYPE.get(storageKey.getProvider());\n        if (storage == null) {\n            throw new IllegalStateException(\n                \"No AiResourceStorage for provider: \" + storageKey.getProvider());\n        }\n        return storage;\n    }\n    \n    public Map<String, AiResourceStorage> allStorages() {\n        return Collections.unmodifiableMap(STORAGES_BY_TYPE);\n    }\n    \n    /**\n     * Register a storage implementation at runtime using first-wins semantics.\n     *\n     * <p>Mainly for tests or embedding scenarios. A duplicate type is ignored with a warning.</p>","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin/ai/src/main/java/com/alibaba/nacos/plugin/ai/storage/AiResourceStorageRouter.java#L62-L98","documentation":"Thrown by AiResourceStorageRouter.route as IllegalStateException when the AI_STORAGE plugin for the provider is reported disabled by PluginStateCheckerHolder. The provider name is non-blank and passed validation, but the plugin is gated off, so routing refuses to hand out a (possibly present) storage implementation.","triggerScenarios":"Routing an AI resource storage operation (MCP/A2A/prompt/skill persistence) to a provider whose AI_STORAGE plugin has been disabled via plugin management. Reached by AI registry storage operations.","commonSituations":"Operator disabling an AI storage plugin during maintenance and then issuing AI resource operations; plugin state not restored after a config reload; multi-provider setup where one provider's plugin was turned off.","solutions":["Re-enable the AI_STORAGE plugin for the provider via the plugin management API.","Verify StorageKey.provider matches an enabled plugin before routing.","Keep plugin enablement in sync with the providers referenced by AI resource configurations."],"exampleFix":"// before: AI storage plugin disabled\nrouter.route(new StorageKey(\"myProvider\")); // -> IllegalStateException disabled\n\n// after: re-enable the plugin\n// POST /v3/admin/plugin/enable { type:\"AI_STORAGE\", name:\"myProvider\" }\nrouter.route(new StorageKey(\"myProvider\"));","handlingStrategy":"validation","validationCode":"if (!PluginStateCheckerHolder.isPluginEnabled(\n        PluginType.AI_STORAGE.getType(), storageKey.getProvider())) {\n    // re-enable the AI_STORAGE plugin before routing\n}","typeGuard":"static boolean aiStorageEnabled(String provider) {\n    return PluginStateCheckerHolder.isPluginEnabled(\n        PluginType.AI_STORAGE.getType(), provider);\n}","tryCatchPattern":"try {\n    return router.route(key);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"is disabled\")) {\n        // enable AI_STORAGE plugin then retry\n    } else throw e;\n}","preventionTips":["Keep AI storage plugin enablement in sync with configured providers.","Check plugin state before routing AI resource operations.","Restore plugin state after maintenance."],"tags":["ai","storage","plugin","disabled","illegal-state"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}