{"record":{"id":"3d9eff64456c1c94","repo":"alibaba/nacos","slug":"10000-3d9eff","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/AgentSpecOnlineForm.java","lineNumber":50,"sourceCode":"    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    /**\n     * \"agentspec\" means enable/disable the whole agentspec. Otherwise version-level.\n     */\n    private String scope;\n    \n    /**\n     * Version for version-level online/offline.\n     */\n    private String version;\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    }\n    \n    public String getScope() {\n        return scope;\n    }\n    \n    public void setScope(String scope) {\n        this.scope = scope;\n    }\n    \n    @Override\n    public String getVersion() {\n        return version;\n    }\n    \n    @Override","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecOnlineForm.java#L32-L68","documentation":"Thrown by RadModelValidator.validateAbsoluteUri when a URI field (e.g. provider.url) is syntactically invalid (java.net.URISyntaxException). It first length-checks (1-2048), attempts new URI(value), and on a syntax failure wraps the cause with 'Invalid <fieldName>: <value>'. A separate message covers the 'must be an absolute URI' (parses but not absolute) case.","triggerScenarios":"Registering an AgentProvider whose url is malformed (unencoded spaces, stray characters, missing scheme) — RadModelValidator.validateProvider (line 523) calls validateAbsoluteUri(value, \"provider.url\").","commonSituations":"URLs pasted with spaces or unicode not percent-encoded; missing scheme ('example.com/x' instead of 'https://example.com/x'); trailing punctuation copied from docs; a URL built by string concatenation that omitted encoding.","solutions":["Percent-encode the URL and ensure it has an explicit scheme (e.g. https://).","Validate with new URI(value) and isAbsolute() client-side before submission.","Build URLs with a URI builder rather than string concatenation."],"exampleFix":"// before\nprovider.setUrl(\"https://ex ample.com/desc\");\n// after\nprovider.setUrl(\"https://example.com/desc\");","handlingStrategy":"validation","validationCode":"if (value == null || value.length() > 2048) {\n    throw new IllegalArgumentException(\"Invalid \" + fieldName + \": \" + value);\n}\ntry {\n    if (!new URI(value).isAbsolute()) {\n        throw new IllegalArgumentException(fieldName + \" must be an absolute URI\");\n    }\n} catch (URISyntaxException e) {\n    throw new IllegalArgumentException(\"Invalid \" + fieldName + \": \" + value, e);\n}","typeGuard":"static boolean isAbsoluteUri(String s) {\n    if (s == null || s.length() > 2048) return false;\n    try { return new URI(s).isAbsolute(); } catch (URISyntaxException e) { return false; }\n}","tryCatchPattern":"try {\n    RadModelValidator.validate(request);\n} catch (IllegalArgumentException e) {\n    // return 400, malformed provider.url\n}","preventionTips":["Percent-encode URLs; always include a scheme.","Build URIs with a URI builder, not concatenation."],"tags":["ai-agent","validation","uri","provider","rad","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}