{"record":{"id":"3df45e44a8b0e983","repo":"alibaba/nacos","slug":"plugin-config-value-is-not-a-boolean-key-3df45e","errorCode":null,"errorMessage":"Plugin config value is not a boolean: {key}","messagePattern":"Plugin config value is not a boolean: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugin-default-impl/nacos-ldap-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/ldap/LdapAuthPluginConfig.java","lineNumber":152,"sourceCode":"        return result;\n    }\n    \n    private static long parsePositiveLong(String value, String key) {\n        try {\n            long result = Long.parseLong(value);\n            if (result <= 0) {\n                throw new IllegalArgumentException(\"Plugin config value must be positive: \" + key);\n            }\n            return result;\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\"Plugin config value is not a number: \" + key, e);\n        }\n    }\n    \n    private static boolean parseBoolean(String value, String key) {\n        if (!Boolean.TRUE.toString().equalsIgnoreCase(value)\n            && !Boolean.FALSE.toString().equalsIgnoreCase(value)) {\n            throw new IllegalArgumentException(\"Plugin config value is not a boolean: \" + key);\n        }\n        return Boolean.parseBoolean(value);\n    }\n    \n    public String getUrl() {\n        return url;\n    }\n    \n    public String getBaseDn() {\n        return baseDn;\n    }\n    \n    public long getTimeout() {\n        return timeout;\n    }\n    \n    public String getUserDn() {\n        return userDn;","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-ldap-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/ldap/LdapAuthPluginConfig.java#L134-L170","documentation":"Thrown by LdapAuthPluginConfig.parseBoolean() when the case-sensitive or ignore-partial-result-exception config value is not a recognized boolean literal. The parser only accepts \"true\" or \"false\" (case-insensitive); anything else is rejected with IllegalArgumentException naming the offending key.","triggerScenarios":"LdapAuthPluginConfig.from() parses case-sensitive or ignore-partial-result-exception; the value is something like \"yes\", \"1\", \"on\", or \"True\"-variant-not-matching. Since the check uses Boolean.TRUE.toString()/Boolean.FALSE.toString() with equalsIgnoreCase, only \"true\"/\"false\" pass.","commonSituations":"Operator uses a common-but-unsupported boolean spelling (\"yes\", \"1\", \"on\", \"enabled\"); a config template from another tool uses non-standard boolean values.","solutions":["Use exactly \"true\" or \"false\" (case-insensitive) for case-sensitive and ignore-partial-result-exception.","Omit the key to accept the documented defaults (case-sensitive=true, ignore-partial-result-exception=false).","Audit the config file for any non-standard boolean spellings."],"exampleFix":"# before\nnacos.plugin.auth.ldap.case-sensitive=yes\n\n# after\nnacos.plugin.auth.ldap.case-sensitive=true","handlingStrategy":"validation","validationCode":"String value = config.getOrDefault(\"case-sensitive\", \"true\");\nif (!value.equalsIgnoreCase(\"true\") && !value.equalsIgnoreCase(\"false\")) {\n    throw new IllegalArgumentException(\"must be 'true' or 'false'\");\n}","typeGuard":"static boolean isBooleanLiteral(String value) {\n    return value != null\n        && (value.equalsIgnoreCase(\"true\") || value.equalsIgnoreCase(\"false\"));\n}","tryCatchPattern":"try {\n    LdapAuthPluginConfig parsed = LdapAuthPluginConfig.from(config);\n} catch (IllegalArgumentException e) {\n    // if message contains 'not a boolean', use exactly true/false\n}","preventionTips":["Use exactly \"true\" or \"false\" for boolean config keys.","Do not use \"yes\", \"1\", \"on\", or other spellings.","Omit optional boolean keys to accept documented defaults."],"tags":["auth","ldap","config","validation","boolean","illegal-argument","java"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}