alibaba/nacos · error · IllegalStateException
No AiResourceStorage for provider: + storageKey.getProvider
Error message
No AiResourceStorage for provider: + storageKey.getProvider()
What it means
Thrown by AiResourceStorageRouter.route as IllegalStateException when STORAGES_BY_TYPE has no entry for the provider. The provider passed the blank-check and the plugin-state check, but no AiResourceStorage implementation was registered for it.
Source
Thrown at plugin/ai/src/main/java/com/alibaba/nacos/plugin/ai/storage/AiResourceStorageRouter.java:85
/**
* 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>
*
* @param storage storage implementation
* @return true if storage is joined
*/
public static synchronized boolean join(AiResourceStorage storage) {View on GitHub (pinned to 9b989acdf1)
Solutions
- Install the AI storage plugin JAR providing an AiResourceStorage implementation for the provider.
- Confirm STORAGES_BY_TYPE contains the provider key after startup.
- Use a provider that has a registered storage implementation, or register one via SPI.
Example fix
// before: no storage impl for provider
router.route(new StorageKey("unknownProvider")); // -> IllegalStateException no storage
// after: install/register an AiResourceStorage for the provider
// public class MyProviderAiStorage implements AiResourceStorage { ... }
// META-INF/services registration
router.route(new StorageKey("myProvider")); Defensive patterns
Strategy: try-catch
Validate before calling
boolean hasStorage = router.allStorages().containsKey(storageKey.getProvider());
if (!hasStorage) {
// install/register an AiResourceStorage for the provider
} Type guard
static boolean aiStorageRegistered(AiResourceStorageRouter r, String provider) {
return provider != null && r.allStorages().containsKey(provider);
} Try / catch
try {
return router.route(key);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("No AiResourceStorage for provider")) {
// install provider storage plugin and retry
} else throw e;
} Prevention
- Install the AI storage plugin JAR providing an AiResourceStorage for the provider.
- Confirm STORAGES_BY_TYPE contains the provider after startup.
- Use a provider with a registered storage implementation.
When it happens
Trigger: Routing an AI resource storage operation to a provider for which no AiResourceStorage SPI implementation was loaded. Distinct from the disabled case: the plugin is enabled but the implementation is absent.
Common situations: Referencing a provider whose storage plugin JAR is missing; SPI registration broken; startup load skipped; provider typo that nonetheless passes the (lenient) plugin-state check.
Related errors
- AiResourceStorage plugin is disabled: + storageKey.getProvi
- RESOURCE_NOT_FOUND
- No DatabaseDialect implementation found for selected type:
- DATA_ACCESS_ERROR
- PARAMETER_VALIDATE_ERROR
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/7ae1c75ca42c6412.
Report an issue: GitHub.