alibaba/nacos · critical · NacosRuntimeException

50001

50001

Error message

Invalid auth type, Please set `nacos.plugin.auth.type` (legacy alias: `nacos.core.auth.system.type`), detail: https://nacos.io/docs/latest/manual/admin/auth/

What it means

Thrown by NacosServerAdminAuthConfig.validate() (ADMIN_API auth scope) at startup/config-reload when authentication is enabled (nacos.core.auth.enabled=true) but the auth system type is empty. The type is resolved via AuthPluginTypeResolver from nacos.plugin.auth.type (legacy alias nacos.core.auth.system.type). Error code 50001 (AuthErrorCode.INVALID_TYPE). This is a server bootstrap/configuration failure — the server refuses to run in this inconsistent state.

Source

Thrown at core/src/main/java/com/alibaba/nacos/core/auth/NacosServerAdminAuthConfig.java:69

    private String serverIdentityKey;
    
    private String serverIdentityValue;
    
    public NacosServerAdminAuthConfig() {
        super("NacosServerAdminAuth");
        resetConfig();
        validate();
    }
    
    /**
     * Validate auth config.
     */
    private void validate() {
        if (!authEnabled) {
            return;
        }
        if (StringUtils.isEmpty(nacosAuthSystemType)) {
            throw new NacosRuntimeException(AuthErrorCode.INVALID_TYPE.getCode(),
                AuthErrorCode.INVALID_TYPE.getMsg());
        }
        if (StringUtils.isEmpty(serverIdentityKey) || StringUtils.isEmpty(serverIdentityValue)) {
            throw new NacosRuntimeException(AuthErrorCode.EMPTY_IDENTITY.getCode(),
                AuthErrorCode.EMPTY_IDENTITY.getMsg());
        }
    }
    
    @Override
    public String getAuthScope() {
        return NACOS_SERVER_ADMIN_AUTH_SCOPE;
    }
    
    /**
     * server auth function is open.
     *
     * @return server auth function is open
     */

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Set nacos.plugin.auth.type=nacos (or your custom auth plugin type) in application.properties when auth is enabled.
  2. If upgrading, ensure the legacy nacos.core.auth.system.type value is migrated to nacos.plugin.auth.type.
  3. Alternatively, disable auth (nacos.core.auth.enabled=false) if auth is not intended.
  4. Restart the server after correcting the config.

Example fix

# before (broken)
nacos.core.auth.enabled=true
# (no type set)

# after (fixed)
nacos.core.auth.enabled=true
nacos.plugin.auth.type=nacos
Defensive patterns

Strategy: validation

Validate before calling

# Shell pre-flight check before starting Nacos with auth enabled
if grep -q 'nacos.core.auth.enabled=true' application.properties \
   && ! grep -qE 'nacos.plugin.auth.type|nacos.core.auth.system.type' application.properties; then
  echo 'ERROR: auth enabled but nacos.plugin.auth.type is not set'; exit 1;
fi

Prevention

When it happens

Trigger: Setting nacos.core.auth.enabled=true (or nacos.plugin.auth.enabled) without also setting nacos.plugin.auth.type / nacos.core.auth.system.type. Applies to the admin API auth scope (NACOS_SERVER_ADMIN_AUTH_SCOPE). Thrown during NacosServerAdminAuthConfig construction or dynamic config reset.

Common situations: Operator enables auth in application.properties but forgets the type property. Migration from legacy property name without carrying over the value. Custom deployment (Helm/k8s) setting only the enabled flag.

Related errors


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