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 NacosServerAuthConfig.validate() (OPEN_API auth scope) at startup/config-reload when authentication is enabled but the auth system type is empty. Identical logic to the admin-scope variant (1034) but applies to the OPEN_API scope (NacosServerAuthConfig.NACOS_SERVER_AUTH_SCOPE = ApiType.OPEN_API), governing client-facing Open API auth. Error code 50001 (AuthErrorCode.INVALID_TYPE). The type comes from nacos.plugin.auth.type (legacy nacos.core.auth.system.type).
Source
Thrown at core/src/main/java/com/alibaba/nacos/core/auth/NacosServerAuthConfig.java:69
private String serverIdentityKey;
private String serverIdentityValue;
public NacosServerAuthConfig() {
super("NacosServerAuth");
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_AUTH_SCOPE;
}
/**
* server auth function is open.
*
* @return server auth function is open
*/View on GitHub (pinned to 9b989acdf1)
Solutions
- Set nacos.plugin.auth.type=nacos (or custom plugin type) whenever auth is enabled.
- Migrate the legacy nacos.core.auth.system.type if upgrading.
- Disable auth if it was enabled unintentionally.
- Restart after correcting the property.
Example fix
# before (broken) nacos.core.auth.enabled=true # (no type) # after (fixed) nacos.core.auth.enabled=true nacos.plugin.auth.type=nacos
Defensive patterns
Strategy: validation
Validate before calling
# Same pre-flight as 1034 — auth type is shared across scopes 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
- Set nacos.plugin.auth.type whenever auth is enabled (covers OPEN_API scope).
- Migrate the legacy property name on upgrade.
- Validate config in deployment automation before startup.
- Document the type requirement alongside the enabled flag.
When it happens
Trigger: Auth enabled (nacos.core.auth.enabled=true) without nacos.plugin.auth.type set, validated by the OPEN_API-scope config. Differs from 1034 only in which auth scope config triggers it — this one covers client/Open API requests. Thrown during NacosServerAuthConfig construction or dynamic reset.
Common situations: Same as 1034: enabling auth without specifying the type. Production deployments where the OPEN_API scope config is initialized before the type is resolvable. Env-var-based config missing the type variable.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/0ed2c5efa67f6241.
Report an issue: GitHub.