{"record":{"id":"0b49904916cf440c","repo":"alibaba/nacos","slug":"10000-0b4990","errorCode":"10000","errorMessage":"Request parameter `agentSpecName` should not be blank.","messagePattern":"Request parameter `agentSpecName` should not be blank\\.","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecPublishForm.java","lineNumber":51,"sourceCode":"    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String version;\n    \n    /**\n     * Legacy latest label update flag.\n     *\n     * @deprecated since 3.3.0, the latest label is managed by the server. This\n     * parameter is ignored and retained only for compatibility with legacy clients.\n     */\n    @Deprecated(since = \"3.3.0\")\n    private Boolean updateLatestLabel;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultNamespaceId();\n        if (StringUtils.isBlank(getAgentSpecName())) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Request parameter `agentSpecName` should not be blank.\");\n        }\n        if (StringUtils.isBlank(version)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Request parameter `version` should not be blank.\");\n        }\n    }\n    \n    @Override\n    public String getVersion() {\n        return version;\n    }\n    \n    @Override\n    public void setVersion(String version) {\n        this.version = version;\n    }\n    ","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecPublishForm.java#L33-L69","documentation":"Thrown by Instance.validate() (HTTP 400, NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING) when the 'ip' field is blank after fillDefaultValue(). The naming Instance model requires a non-blank ip for registration; this is the legacy/service-discovery Instance, distinct from the AI Endpoint model. validate() is called during instance register/update APIs.","triggerScenarios":"Calling a naming instance register or update API (Open API /v3/client/ns/instance or equivalent) with ip unset, empty, or whitespace-only. The Instance.validate() hook runs at the controller/service boundary.","commonSituations":"A client constructing an Instance and forgetting setIp; a form bind that loses the ip parameter; whitespace from a config; registering an instance from a hostname-only source where ip was not resolved.","solutions":["Set a non-blank ip (IPv4/IPv6/hostname as the API expects) before registering the Instance.","Null/blank-check ip at the client before the register call.","If registering by service name only, use the correct API/overload rather than leaving ip blank."],"exampleFix":"// before\nInstance inst = new Instance();\ninst.setPort(8080);\nnaming.registerInstance(serviceName, inst);\n// after\nInstance inst = new Instance();\ninst.setIp(\"10.0.0.5\");\ninst.setPort(8080);\nnaming.registerInstance(serviceName, inst);","handlingStrategy":"validation","validationCode":"if (org.apache.commons.lang3.StringUtils.isBlank(instance.getIp())) {\n    throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n        \"Required parameter 'ip' type String is not present\");\n}","typeGuard":"static boolean hasInstanceIp(Instance i) {\n    return i != null && i.getIp() != null && !i.getIp().trim().isEmpty();\n}","tryCatchPattern":"try {\n    instance.validate();\n} catch (NacosApiException e) {\n    if (e.getErrCode() == NacosException.INVALID_PARAM) {\n        // surface 400 to client with missing 'ip'\n    }\n}","preventionTips":["Always setIp before registering an Instance.","Blank-check ip in the client SDK before the network call."],"tags":["naming","instance","validation","parameter-missing","http-400"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}