{"record":{"id":"da5f47fd40d8b508","repo":"apache/dubbo","slug":"unrecognized-value-value-please-check-if-value","errorCode":null,"errorMessage":"unrecognized value {value} , please check if value is illegal. Permitted values: {values}","messagePattern":"unrecognized value (.+?) , please check if value is illegal\\. Permitted values: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/FixedParamValue.java","lineNumber":59,"sourceCode":"            }\n        }\n        val2Index = Collections.unmodifiableMap(valueMap);\n    }\n\n    /**\n     * DEFAULT value will be returned if n = 0\n     * @param n\n     */\n    @Override\n    public String getN(int n) {\n        return values[n];\n    }\n\n    @Override\n    public int getIndex(String value) {\n        Integer offset = val2Index.get(value.toLowerCase(Locale.ROOT));\n        if (offset == null) {\n            throw new IllegalArgumentException(\"unrecognized value \" + value\n                    + \" , please check if value is illegal. \" + \"Permitted values: \"\n                    + Arrays.asList(values));\n        }\n        return offset;\n    }\n}\n","sourceCodeStart":41,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/FixedParamValue.java#L41-L66","documentation":"Thrown by FixedParamValue.getIndex when the requested value (lowercased) is not among the permitted values supplied at construction. FixedParamValue enforces a closed value set; any value outside it is rejected because the compact-table encoding has no slot for it. The message lists the allowed values to aid diagnosis.","triggerScenarios":"FixedParamValue.getIndex(value) is called where value.toLowerCase() is not a key in val2Index. Triggered during URL param compaction when a URL carries a value for a fixed-set key that was not declared in the FixedParamValue's values array.","commonSituations":"A new/typo'd enum-like param value appears in a URL (e.g. 'tru' instead of 'true' for a boolean key), or a custom DynamicParamSource declares a fixed set that is incomplete relative to what producers actually emit. Version skew between producer and consumer param sets also triggers it.","solutions":["Read the 'Permitted values' list in the message and correct the offending value to one of them.","If the value is legitimately new, extend the FixedParamValue's allowed set in the relevant DynamicParamSource extension (requires rebuild/redeploy).","If the value set cannot be enumerated ahead of time, switch that key to DynamicValues so unknown values are interned dynamically."],"exampleFix":"// before\nFixedParamValue pv = new FixedParamValue(\"true\", \"false\");\npv.getIndex(\"tru\"); // throws\n\n// after\npv.getIndex(\"true\");\n// or make the set open:\nnew DynamicValues(null).getIndex(\"tru\");","handlingStrategy":"validation","validationCode":"FixedParamValue pv = /* ... */;\nString value = \"...\";\n// pre-check membership\nif (pv.getIndex(value) < 0) { /* not in set */ }\n// note: getIndex throws on miss, so guard before calling in best-effort code","typeGuard":"// Best-effort: catch to test membership\nstatic boolean isPermitted(FixedParamValue pv, String value) {\n    try { pv.getIndex(value); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    int idx = pv.getIndex(value);\n} catch (IllegalArgumentException e) {\n    // value not in permitted set; use a default or reject the URL\n}","preventionTips":["Keep the FixedParamValue permitted set in sync with values producers actually emit.","Validate param values at the trust boundary before they reach compaction.","Switch a key to DynamicValues if its value set is effectively open."],"tags":["internal-api","param-table","validation","value-set"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}