{"record":{"id":"48cdb2c835f63d3c","repo":"alibaba/nacos","slug":"20012","errorCode":"20012","errorMessage":"config gray rule version invalid","messagePattern":"config gray rule version invalid","errorType":"http","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java","lineNumber":202,"sourceCode":"     * @param configRequestInfo ConfigRequestInfo\n     * @return boolean\n     * @throws NacosException NacosException.\n     * @date 2024/2/5\n     */\n    public Boolean publishConfigGray(String grayType, ConfigForm configForm,\n        ConfigRequestInfo configRequestInfo)\n        throws NacosException {\n        configForm\n            .setNamespaceId(NamespaceUtil.processNamespaceParameter(configForm.getNamespaceId()));\n        \n        Map<String, Object> configAdvanceInfo = getConfigAdvanceInfo(configForm);\n        ParamUtils.checkParam(configAdvanceInfo);\n        \n        ConfigGrayPersistInfo localConfigGrayPersistInfo = new ConfigGrayPersistInfo(grayType,\n            configForm.getGrayVersion(), configForm.getGrayRuleExp(), configForm.getGrayPriority());\n        GrayRule grayRuleStruct = GrayRuleManager.constructGrayRule(localConfigGrayPersistInfo);\n        if (grayRuleStruct == null) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.CONFIG_GRAY_VERSION_INVALID,\n                ErrorCode.CONFIG_GRAY_VERSION_INVALID.getMsg());\n        }\n        \n        if (!grayRuleStruct.isValid()) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.CONFIG_GRAY_RULE_FORMAT_INVALID,\n                ErrorCode.CONFIG_GRAY_RULE_FORMAT_INVALID.getMsg());\n        }\n        \n        //version count check.\n        if (checkGrayVersionOverMaxCount(configForm.getDataId(), configForm.getGroup(),\n            configForm.getNamespaceId(),\n            configForm.getGrayName())) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.CONFIG_GRAY_OVER_MAX_VERSION_COUNT,\n                \"gray config version is over max count :\" + getMaxGrayVersionCount());\n        }","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java#L184-L220","documentation":"Error \"config gray rule version invalid\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java:202 when the library encounters an invalid state.","commonSituations":"Publishing a gray rule whose version does not match the current config version.","solutions":["Correct the invalid value for gray rule version to match the expected format or allowed set, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}