{"record":{"id":"1498b456a3a3336b","repo":"alibaba/nacos","slug":"parameter-missing-1498b4","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'healthy' type Boolean is not present","messagePattern":"Required parameter 'healthy' type Boolean is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/model/form/UpdateHealthForm.java","lineNumber":60,"sourceCode":"    \n    private String clusterName;\n    \n    private String ip;\n    \n    private Integer port;\n    \n    public UpdateHealthForm() {\n    }\n    \n    /**\n     * check param.\n     *\n     * @throws NacosApiException NacosApiException\n     */\n    public void validate() throws NacosApiException {\n        fillDefaultValue();\n        if (healthy == null) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'healthy' type Boolean is not present\");\n        }\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        if (StringUtils.isBlank(ip)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'ip' type String is not present\");\n        }\n        if (port == null) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'port' type Integer is not present\");\n        }\n    }\n    \n    /**\n     * fill default value.","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/model/form/UpdateHealthForm.java#L42-L78","documentation":"Thrown by UpdateHealthForm.validate() when the 'healthy' Boolean field is null in a manual health-status update request. Nacos lets an admin force an instance's healthy flag; without it the operation is undefined, so validate() returns HTTP 400 PARAMETER_MISSING. It is the first check after fillDefaultValue().","triggerScenarios":"PUT/POST to the instance health update endpoint (e.g. /v3/admin/ns/health/instance or legacy /nacos/v1/ns/health/instance) with no 'healthy' param, or a value Spring cannot parse to Boolean.","commonSituations":"Sending healthy='' (empty) which becomes null Boolean; calling the beat/health API for the first time and forgetting the flag; UI checkbox that submits nothing when unchecked.","solutions":["Send an explicit 'healthy=true' or 'healthy=false'.","Use a boolean literal, not empty string; some clients send 'on'/'off' which Spring may not map to Boolean.","Pre-validate: Objects.requireNonNull(form.getHealthy())."],"exampleFix":"// before\ncurl -X PUT '.../health/instance' -d 'serviceName=my-service&ip=10.0.0.1&port=8080'\n// after\ncurl -X PUT '.../health/instance' -d 'serviceName=my-service&ip=10.0.0.1&port=8080&healthy=false'","handlingStrategy":"validation","validationCode":"if (healthy == null) {\n    throw new IllegalArgumentException(\"healthy flag is required (true/false)\");\n}\nform.setHealthy(healthy);","typeGuard":"static boolean hasHealthyFlag(Boolean b) {\n    return b != null;\n}","tryCatchPattern":null,"preventionTips":["Send healthy=true or healthy=false as a literal, never empty.","If using a checkbox, map unchecked to false explicitly.","Pre-validate the whole UpdateHealthForm before submit."],"tags":["naming","rest-api","validation","parameter-missing","instance","health-check"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}