{"record":{"id":"2eb95fcf23159c30","repo":"alibaba/nacos","slug":"10000-2eb95f","errorCode":"10000","errorMessage":"The parameters quota, maxSize, maxAggrCount, maxAggrSize cannot be empty at the same time","messagePattern":"The parameters quota, maxSize, maxAggrCount, maxAggrSize cannot be empty at the same time","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"config/src/main/java/com/alibaba/nacos/config/server/model/form/UpdateCapacityForm.java","lineNumber":98,"sourceCode":"        return maxAggrCount;\n    }\n    \n    public void setMaxAggrCount(Integer maxAggrCount) {\n        this.maxAggrCount = maxAggrCount;\n    }\n    \n    public Integer getMaxAggrSize() {\n        return maxAggrSize;\n    }\n    \n    public void setMaxAggrSize(Integer maxAggrSize) {\n        this.maxAggrSize = maxAggrSize;\n    }\n    \n    @Override\n    public void validate() throws NacosApiException {\n        if (quota == null && maxSize == null && maxAggrCount == null && maxAggrSize == null) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"The parameters quota, maxSize, maxAggrCount, maxAggrSize cannot be empty at the same time\");\n        }\n    }\n    \n    /**\n     * Check namespaceId and groupName.\n     *\n     * @param capacityService capacity service\n     * @throws NacosApiException NacosApiException\n     */\n    public void checkNamespaceIdAndGroupName(CapacityService capacityService)\n        throws NacosApiException {\n        if (StringUtils.isBlank(groupName) && StringUtils.isBlank(namespaceId)) {\n            capacityService.initAllCapacity();\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"At least one of the parameters (groupName or namespaceId) must be provided\");\n        }\n    }","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/config/src/main/java/com/alibaba/nacos/config/server/model/form/UpdateCapacityForm.java#L80-L116","documentation":"Thrown by UpdateCapacityForm.validate() when all four capacity parameters (quota, maxSize, maxAggrCount, maxAggrSize) are null simultaneously. Returns HTTP 400 code 10000 (PARAMETER_MISSING). At least one capacity value must be provided to perform an update.","triggerScenarios":"Calling PUT /v3/admin/cs/capacity (or the capacity update API) with no capacity fields set in the request body. Each field is optional individually, but all-null is rejected.","commonSituations":"Capacity update form submitted empty; JSON body with null values for all four fields; frontend sending the form without any user-filled capacity input.","solutions":["Provide at least one of quota, maxSize, maxAggrCount, or maxAggrSize in the request.","Populate only the capacity dimension you want to change; the others remain unchanged on the server.","Validate the form client-side to ensure at least one field is set."],"exampleFix":"// before\nPUT /v3/admin/cs/capacity  { \"namespaceId\":\"\", \"groupName\":\"G\" } // no capacity\n// after\nPUT /v3/admin/cs/capacity  { \"namespaceId\":\"\", \"groupName\":\"G\", \"quota\":1000 }","handlingStrategy":"validation","validationCode":"if (quota == null && maxSize == null && maxAggrCount == null && maxAggrSize == null) {\n    throw new IllegalArgumentException(\"At least one capacity field must be set\");\n}","typeGuard":null,"tryCatchPattern":"try { capacityApi.update(form); }\ncatch (NacosApiException e) {\n    if (e.getErrCode() == ErrorCode.PARAMETER_MISSING.getCode())\n        { /* supply a capacity value */ } else throw e;\n}","preventionTips":["Always set at least one capacity dimension when updating.","Validate the form client-side."],"tags":["config","capacity","parameter-missing","validation"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}