alibaba/nacos · warning · NacosApiException

API_FUNCTION_DISABLED

API_FUNCTION_DISABLED

Error message

AI resource import is disabled.

What it means

Thrown by AiResourceImportPluginManager.requireModuleEnabled() when the entire AI resource import feature is turned off. It is the first check in resolveBuilder and listSourceInfos, consulting AiResourceImportProperties.isEnabled() (loaded from environment). Mapped to API_FUNCTION_DISABLED with a SERVER_NOT_IMPLEMENTED top-level code, indicating the server does not implement this capability in its current configuration.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/importer/manager/AiResourceImportPluginManager.java:154

                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "AI resource import plugin is disabled: " + pluginName);
        }
        if (!supportsResourceType(result, resourceType)) {
            throw new NacosApiException(NacosException.INVALID_PARAM,
                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "AI resource import plugin does not support resource type: " + resourceType);
        }
        return result;
    }
    
    private Map<String, AiResourceImportServiceBuilder> getLoadedPlugins() {
        Map<String, AiResourceImportServiceBuilder> result = builders;
        return result == null ? Collections.emptyMap() : result;
    }
    
    private void requireModuleEnabled() throws NacosException {
        if (!propertiesSupplier.get().isEnabled()) {
            throw new NacosApiException(NacosException.SERVER_NOT_IMPLEMENTED,
                ErrorCode.API_FUNCTION_DISABLED, "AI resource import is disabled.");
        }
    }
    
    private boolean isPluginEnabled(String pluginName) {
        return PluginStateCheckerHolder.isPluginEnabled(
            PluginType.AI_RESOURCE_IMPORT.getType(), pluginName);
    }
    
    private boolean supportsResourceType(AiResourceImportServiceBuilder builder,
        String resourceType) {
        return StringUtils.isBlank(resourceType)
            || builder.supportedResourceTypes().contains(resourceType);
    }
    
    private AiResourceImportSourceInfo toSourceInfo(AiResourceImportServiceBuilder builder) {
        AiResourceImportSourceInfo result = new AiResourceImportSourceInfo();
        result.setSourceId(builder.pluginName());

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Enable the AI resource import feature by setting the corresponding property/environment variable read by AiResourceImportProperties.
  2. Confirm the server build actually includes the ai module and the importer classes.
  3. If the feature must stay off, stop calling the import APIs from the client.
Defensive patterns

Strategy: validation

Validate before calling

// Before exposing import features, check the module flag
if (!aiResourceImportProperties.isEnabled()) {
    return FeatureGate.disabled("AI resource import is not enabled on this server");
}

Try / catch

try {
    manager.listSources(resourceType);
} catch (NacosApiException e) {
    if (ErrorCode.API_FUNCTION_DISABLED.getCode() == e.getDetailErrCode()) {
        // feature off: hide the import UI rather than retry
        return FeatureGate.disabledResponse();
    }
    throw e;
}

Prevention

When it happens

Trigger: Any AI resource import API call (list/search/validate/execute) when propertiesSupplier.get().isEnabled() returns false. Fires before any plugin lookup, so it blocks the whole module.

Common situations: A deployment that has not opted into the AI resource import feature; the enable flag (read from environment/config via AiResourceImportProperties.loadFromEnvironment) is unset or explicitly false; a hardened/minimal server image that ships the module disabled by default.

Related errors


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