alibaba/nacos · error · IllegalStateException

AiResourceStorage plugin is disabled: + storageKey.getProvi

Error message

AiResourceStorage plugin is disabled:  + storageKey.getProvider()

What it means

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.

Source

Thrown at plugin/ai/src/main/java/com/alibaba/nacos/plugin/ai/storage/AiResourceStorageRouter.java:80

     * @return router instance
     */
    public static AiResourceStorageRouter getInstance() {
        return INSTANCE;
    }
    
    /**
     * Route to storage implementation by {@link StorageKey#getProvider()}.
     *
     * @param storageKey storage key
     * @return storage implementation
     */
    public AiResourceStorage route(StorageKey storageKey) {
        if (storageKey == null || StringUtils.isBlank(storageKey.getProvider())) {
            throw new IllegalArgumentException("StorageKey.provider is blank");
        }
        if (!PluginStateCheckerHolder.isPluginEnabled(PluginType.AI_STORAGE.getType(),
            storageKey.getProvider())) {
            throw new IllegalStateException(
                "AiResourceStorage plugin is disabled: " + storageKey.getProvider());
        }
        AiResourceStorage storage = STORAGES_BY_TYPE.get(storageKey.getProvider());
        if (storage == null) {
            throw new IllegalStateException(
                "No AiResourceStorage for provider: " + storageKey.getProvider());
        }
        return storage;
    }
    
    public Map<String, AiResourceStorage> allStorages() {
        return Collections.unmodifiableMap(STORAGES_BY_TYPE);
    }
    
    /**
     * Register a storage implementation at runtime using first-wins semantics.
     *
     * <p>Mainly for tests or embedding scenarios. A duplicate type is ignored with a warning.</p>

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Re-enable the AI_STORAGE plugin for the provider via the plugin management API.
  2. Verify StorageKey.provider matches an enabled plugin before routing.
  3. Keep plugin enablement in sync with the providers referenced by AI resource configurations.

Example fix

// before: AI storage plugin disabled
router.route(new StorageKey("myProvider")); // -> IllegalStateException disabled

// after: re-enable the plugin
// POST /v3/admin/plugin/enable { type:"AI_STORAGE", name:"myProvider" }
router.route(new StorageKey("myProvider"));
Defensive patterns

Strategy: validation

Validate before calling

if (!PluginStateCheckerHolder.isPluginEnabled(
        PluginType.AI_STORAGE.getType(), storageKey.getProvider())) {
    // re-enable the AI_STORAGE plugin before routing
}

Type guard

static boolean aiStorageEnabled(String provider) {
    return PluginStateCheckerHolder.isPluginEnabled(
        PluginType.AI_STORAGE.getType(), provider);
}

Try / catch

try {
    return router.route(key);
} catch (IllegalStateException e) {
    if (e.getMessage().contains("is disabled")) {
        // enable AI_STORAGE plugin then retry
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/156b1d9f91dae1f7. Report an issue: GitHub.