alibaba/nacos · error · NacosApiException

20011

20011

Error message

config gray rule format invalid

What it means

Error "config gray rule format invalid" thrown in alibaba/nacos.

Source

Thrown at config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java:208

        ConfigRequestInfo configRequestInfo)
        throws NacosException {
        configForm
            .setNamespaceId(NamespaceUtil.processNamespaceParameter(configForm.getNamespaceId()));
        
        Map<String, Object> configAdvanceInfo = getConfigAdvanceInfo(configForm);
        ParamUtils.checkParam(configAdvanceInfo);
        
        ConfigGrayPersistInfo localConfigGrayPersistInfo = new ConfigGrayPersistInfo(grayType,
            configForm.getGrayVersion(), configForm.getGrayRuleExp(), configForm.getGrayPriority());
        GrayRule grayRuleStruct = GrayRuleManager.constructGrayRule(localConfigGrayPersistInfo);
        if (grayRuleStruct == null) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),
                ErrorCode.CONFIG_GRAY_VERSION_INVALID,
                ErrorCode.CONFIG_GRAY_VERSION_INVALID.getMsg());
        }
        
        if (!grayRuleStruct.isValid()) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),
                ErrorCode.CONFIG_GRAY_RULE_FORMAT_INVALID,
                ErrorCode.CONFIG_GRAY_RULE_FORMAT_INVALID.getMsg());
        }
        
        //version count check.
        if (checkGrayVersionOverMaxCount(configForm.getDataId(), configForm.getGroup(),
            configForm.getNamespaceId(),
            configForm.getGrayName())) {
            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),
                ErrorCode.CONFIG_GRAY_OVER_MAX_VERSION_COUNT,
                "gray config version is over max count :" + getMaxGrayVersionCount());
        }
        
        ConfigInfo configInfo = new ConfigInfo(configForm.getDataId(), configForm.getGroup(),
            configForm.getNamespaceId(), configForm.getAppName(), configForm.getContent());
        // set old md5
        if (StringUtils.isNotBlank(configRequestInfo.getCasMd5())) {
            configInfo.setMd5(configRequestInfo.getCasMd5());

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Correct the invalid value for gray rule format to match the expected format or allowed set, then retry.

When it happens

Trigger: Thrown at config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java:208 when the library encounters an invalid state.

Common situations: Publishing a gray rule whose expression fails format validation.


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