alibaba/nacos · critical · IllegalArgumentException

Unsupported nacos deployment type {type}

Error message

Unsupported nacos deployment type {type}

What it means

NacosBootstrap switches on the resolved DeploymentType enum (MERGED, SERVER, CONSOLE). The default branch catches any other value and throws IllegalArgumentException with the offending type. The '{type}' in the message is the string form of the runtime variable (the source concatenates the 'type' variable).

Source

Thrown at bootstrap/src/main/java/com/alibaba/nacos/bootstrap/NacosBootstrap.java:64

    private static final String SPRING_JMX_ENABLED = "spring.jmx.enabled";
    
    public static void main(String[] args) {
        String type = System.getProperty(Constants.NACOS_DEPLOYMENT_TYPE,
            Constants.NACOS_DEPLOYMENT_TYPE_MERGED);
        DeploymentType deploymentType = DeploymentType.getType(type);
        EnvUtil.setDeploymentType(deploymentType);
        switch (deploymentType) {
            case MERGED:
                startWithConsole(args);
                break;
            case SERVER:
                startWithoutConsole(args);
                break;
            case CONSOLE:
                startOnlyConsole(args);
                break;
            default:
                throw new IllegalArgumentException("Unsupported nacos deployment type " + type);
        }
    }
    
    private static void prepareCoreContext(ConfigurableApplicationContext coreContext) {
        if (coreContext.getEnvironment().getProperty(SPRING_JMX_ENABLED, Boolean.class, false)) {
            // Avoid duplicate registration MBean to exporter.
            coreContext.getBean(MBeanExporter.class)
                .setRegistrationPolicy(RegistrationPolicy.IGNORE_EXISTING);
        }
    }
    
    private static void startWithoutConsole(String[] args) {
        ConfigurableApplicationContext coreContext = startCoreContext(args);
        prepareCoreContext(coreContext);
        ConfigurableApplicationContext webContext = startServerWebContext(args, coreContext);
        if (isEnabledAiRegistry(coreContext)) {
            ConfigurableApplicationContext aiRegistryContext =
                startAiRegistryContext(args, coreContext);

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Set nacos.deployment.type to one of: MERGED, SERVER, CONSOLE.
  2. Leave the property unset to use the default deployment type for your distribution.
  3. Check the spelling and case against the DeploymentType enum in bootstrap.

Example fix

# before
nacos.deployment.type=STANDALONE   # unsupported -> 559

# after
# either omit, or use a supported value:
nacos.deployment.type=MERGED
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("MERGED", "SERVER", "CONSOLE");
String type = System.getProperty("nacos.deployment.type", "");
if (!type.isEmpty() && !allowed.contains(type.toUpperCase())) {
    throw new IllegalStateException("Unsupported nacos.deployment.type: " + type);
}

Prevention

When it happens

Trigger: Starting the Nacos server with nacos.deployment.type (or -Dnacos.deployment.type) set to an unrecognized string; passing a typo'd enum value.

Common situations: Typo in deployment config (e.g. 'CONSOLE_ONLY', 'STANDALONE', 'ALL'); custom orchestration injecting an unsupported mode; mismatch between config and the supported enum set across versions.

Related errors


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