alibaba/nacos · error · IllegalArgumentException

Plugin config value is not a boolean:

Error message

Plugin config value is not a boolean: 

What it means

Thrown by parseBoolean() when a boolean config value (auto-create-user, strict-nonce-validation, or strict-audience-validation) is neither 'true' nor 'false' (case-insensitive). Any other string is rejected.

Source

Thrown at plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcAuthPluginConfig.java:198

        return StringUtils.isBlank(result) ? defaultValue : result;
    }
    
    private static long parsePositiveLong(String value, String key) {
        try {
            long result = Long.parseLong(value);
            if (result <= 0) {
                throw new IllegalArgumentException("Plugin config value must be positive: " + key);
            }
            return result;
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Plugin config value is not a number: " + key, e);
        }
    }
    
    private static boolean parseBoolean(String value, String key) {
        if (!Boolean.TRUE.toString().equalsIgnoreCase(value)
            && !Boolean.FALSE.toString().equalsIgnoreCase(value)) {
            throw new IllegalArgumentException("Plugin config value is not a boolean: " + key);
        }
        return Boolean.parseBoolean(value);
    }
    
    public boolean isValid() {
        return StringUtils.isNotBlank(issuerUri) && StringUtils.isNotBlank(clientId);
    }
    
    public boolean isJwtValidation() {
        return DEFAULT_TOKEN_VALIDATION_METHOD.equalsIgnoreCase(tokenValidationMethod);
    }
    
    public boolean isIntrospectionValidation() {
        return "introspection".equalsIgnoreCase(tokenValidationMethod);
    }
    
    public String getIssuerUri() {
        return issuerUri;

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Use exactly 'true' or 'false' (any case) for the offending key.
  2. The appended key name identifies which of auto-create-user / strict-nonce-validation / strict-audience-validation is wrong.

Example fix

// before
nacos.plugin.auth.oidc.auto-create-user=yes
// after
nacos.plugin.auth.oidc.auto-create-user=true
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate boolean config keys
private static void assertBoolean(String key, String raw) {
    if (!"true".equalsIgnoreCase(raw) && !"false".equalsIgnoreCase(raw)) {
        throw new IllegalArgumentException(key + " must be true/false, got: " + raw);
    }
}

Try / catch

try {
    OidcAuthPluginConfig.from(configMap);
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("is not a boolean")) {
        log.error("OIDC boolean config error: {}", e.getMessage());
    }
}

Prevention

When it happens

Trigger: Setting auto-create-user=yes, strict-nonce-validation=1, or strict-audience-validation=enabled.

Common situations: Operator uses yes/no, 1/0, enabled/disabled, or on/off instead of true/false; YAML implicit boolean coercion that yields a non-canonical token.

Related errors


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