{"record":{"id":"15c96158e42c2b20","repo":"alibaba/nacos","slug":"10000-15c961","errorCode":"10000","errorMessage":"Required parameter 'grayRuleExp' type String is not present","messagePattern":"Required parameter 'grayRuleExp' type String is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java","lineNumber":549,"sourceCode":"    @Since(\"3.2.2\")\n    @DeleteMapping(\"/gray\")\n    @Secured(action = ActionTypes.WRITE, signType = SignType.CONFIG, apiType = ApiType.ADMIN_API)\n    public Result<Boolean> stopGray(HttpServletRequest request, ConfigFormV3 configForm,\n        @RequestParam(\"grayName\") String grayName) throws NacosApiException {\n        configForm.validate();\n        validateGrayName(grayName);\n        String namespaceId = NamespaceUtil.processNamespaceParameter(configForm.getNamespaceId());\n        String clientIp = getRemoteIp(request);\n        String srcUser = RequestUtil.getSrcUserName(request);\n        return Result.success(\n            configOperationService.deleteConfig(configForm.getDataId(), configForm.getGroupName(),\n                namespaceId, grayName, clientIp, srcUser, Constants.HTTP));\n    }\n    \n    private void validateGrayForm(ConfigFormV3 configForm) throws NacosApiException {\n        validateGrayName(configForm.getGrayName());\n        if (StringUtils.isBlank(configForm.getGrayRuleExp())) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'grayRuleExp' type String is not present\");\n        }\n        if (StringUtils.isBlank(configForm.getGrayVersion())) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'grayVersion' type String is not present\");\n        }\n    }\n    \n    private void validateGrayName(String grayName) throws NacosApiException {\n        if (StringUtils.isBlank(grayName)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'grayName' type String is not present\");\n        }\n        if (!ParamUtils.isValid(grayName.trim())) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"invalid grayName : \" + grayName);\n        }","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java#L531-L567","documentation":"Thrown by validateGrayForm during POST /v3/admin/cs/config/gray when grayRuleExp is blank. The gray rule expression defines which client labels trigger the gray config; without it the gray is meaningless. Returns HTTP 400 code 10000 (PARAMETER_MISSING). For tag gray rules the expression must be in key=value(s) format.","triggerScenarios":"POSTing a gray config without the grayRuleExp field (or grayMatchRuleExp request param), or passing an empty string. Also when grayType is TAG_V2 but no rule expression is supplied.","commonSituations":"First-time gray publish where the developer forgets the rule expression; API client sends grayRuleExp=null; confusion between grayRuleExp and grayMatchRuleExp query params (publishGray uses grayMatchRuleExp which is copied into grayRuleExp).","solutions":["Provide a non-blank grayRuleExp in the ConfigFormV3, e.g. 'zone=us-east-1' for a single-tag rule.","When using the grayMatchRuleExp request param on POST /gray, ensure it is set and non-empty so it is copied into grayRuleExp.","Match the rule format to the grayType (TAG_V2 uses key=value1,value2; multi-tag supports && and ||)."],"exampleFix":"// before\nPOST /v3/admin/cs/config/gray  { \"dataId\":\"app\", \"groupName\":\"G\", \"grayName\":\"r1\", \"grayVersion\":\"v1\" }\n// after\nPOST /v3/admin/cs/config/gray  { \"dataId\":\"app\", \"groupName\":\"G\", \"grayName\":\"r1\", \"grayVersion\":\"v1\", \"grayRuleExp\":\"zone=us-east-1\" }","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(configForm.getGrayRuleExp())\n    && StringUtils.isBlank(grayMatchRuleExp)) {\n    // reject before API call — supply grayRuleExp\n    throw new IllegalArgumentException(\"grayRuleExp is required for gray publish\");\n}","typeGuard":null,"tryCatchPattern":"try { configApi.publishGray(form); }\ncatch (NacosApiException e) {\n    if (e.getErrCode() == ErrorCode.PARAMETER_MISSING.getCode())\n        { /* supply grayRuleExp */ } else throw e;\n}","preventionTips":["Always include grayRuleExp when publishing a gray config.","For TAG_V2 grayType, use key=value format."],"tags":["config","gray-release","parameter-missing","validation"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}