{"record":{"id":"4c139fd38c107364","repo":"alibaba/nacos","slug":"parameter-missing-4c139f","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'serviceName' type String is not present","messagePattern":"Required parameter 'serviceName' type String is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/model/form/InstanceListForm.java","lineNumber":55,"sourceCode":"    private String namespaceId;\n    \n    private String groupName;\n    \n    private String serviceName;\n    \n    private String clusterName;\n    \n    private Boolean healthyOnly;\n    \n    /**\n     * check param.\n     *\n     * @throws NacosApiException NacosApiException\n     */\n    public void validate() throws NacosApiException {\n        fillDefaultValue();\n        if (StringUtils.isBlank(serviceName)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'serviceName' type String is not present\");\n        }\n    }\n    \n    /**\n     * fill default value.\n     */\n    public void fillDefaultValue() {\n        if (StringUtils.isBlank(namespaceId)) {\n            namespaceId = Constants.DEFAULT_NAMESPACE_ID;\n        }\n        if (StringUtils.isBlank(groupName)) {\n            groupName = Constants.DEFAULT_GROUP;\n        }\n        if (StringUtils.isBlank(clusterName)) {\n            clusterName = StringUtils.EMPTY;\n        }\n        if (null == healthyOnly) {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/model/form/InstanceListForm.java#L37-L73","documentation":"Thrown by InstanceListForm.validate() when the 'serviceName' field is blank. This form backs instance list/query APIs (batch instance retrieval). The error carries ErrorCode.PARAMETER_MISSING with HTTP 400.","triggerScenarios":"Calling an instance list API (e.g. GET /v3/client/ns/instance/list) without serviceName, or with serviceName='' / whitespace.","commonSituations":"Client SDK not setting serviceName before the list call, or a script omitting it.","solutions":["Provide a non-blank serviceName parameter.","Ensure the SDK includes serviceName in the list request."],"exampleFix":"// before\nGET /v3/client/ns/instance/list?namespaceId=public&groupName=DEFAULT_GROUP\n// after\nGET /v3/client/ns/instance/list?namespaceId=public&groupName=DEFAULT_GROUP&serviceName=my-service","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(serviceName)) {\n    throw new IllegalArgumentException(\"serviceName is required for instance list\");\n}","typeGuard":"function hasListServiceName(form: { serviceName?: string }): boolean {\n  return typeof form.serviceName === 'string' && form.serviceName.trim().length > 0;\n}","tryCatchPattern":"// Validate before API call\nif (!form.serviceName?.trim()) {\n  throw new Error('serviceName is required');\n}","preventionTips":["Always provide serviceName when listing instances.","Validate in the client SDK before the HTTP call."],"tags":["naming","validation","parameter-missing","instance"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}