{"record":{"id":"915a9546e3a51004","repo":"alibaba/nacos","slug":"parameter-missing-915a95","errorCode":"PARAMETER_MISSING","errorMessage":"namespaceId is required","messagePattern":"namespaceId is required","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/form/SkillsFileQueryForm.java","lineNumber":40,"sourceCode":"import com.alibaba.nacos.common.utils.StringUtils;\n\n/**\n * Query form for skills CLI compatible file fetch endpoint.\n *\n * @author nacos\n */\npublic class SkillsFileQueryForm implements NacosForm {\n    \n    private String namespaceId;\n    \n    private String skillName;\n    \n    private String filePath;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        if (StringUtils.isBlank(namespaceId)) {\n            throw new NacosApiException(NacosApiException.INVALID_PARAM,\n                ErrorCode.PARAMETER_MISSING,\n                \"namespaceId is required\");\n        }\n        if (StringUtils.isBlank(skillName)) {\n            throw new NacosApiException(NacosApiException.INVALID_PARAM,\n                ErrorCode.PARAMETER_MISSING,\n                \"skillName is required\");\n        }\n        if (StringUtils.isBlank(filePath)) {\n            throw new NacosApiException(NacosApiException.INVALID_PARAM,\n                ErrorCode.PARAMETER_MISSING,\n                \"filePath is required\");\n        }\n        if (filePath.startsWith(\"/\") || filePath.startsWith(\"\\\\\") || filePath.contains(\"..\")) {\n            throw new NacosApiException(NacosApiException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"filePath is invalid\");\n        }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/form/SkillsFileQueryForm.java#L22-L58","documentation":"SkillsFileQueryForm backs the skill-file fetch endpoint and requires a non-blank namespaceId. If it is blank, the validator throws PARAMETER_MISSING (HTTP 400).","triggerScenarios":"Calling the skill-file endpoint without ?namespaceId= (or with an empty value).","commonSituations":"Assuming the server defaults the namespace; a client that does not propagate the tenant; URL building that drops the empty param.","solutions":["Pass ?namespaceId=<ns> explicitly.","If you mean the default namespace, send its id rather than omitting the param.","Ensure your client always sets namespaceId for skill-file queries."],"exampleFix":"// before\nGET /skill-file?skillName=x&filePath=README.md\n\n// after\nGET /skill-file?namespaceId=public&skillName=x&filePath=README.md","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(namespaceId)) {\n    throw new IllegalArgumentException(\"namespaceId is required for skill-file queries\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set namespaceId in the client, even for the default namespace.","Centralize required-param checks in a request builder.","Log which param is missing when validation fails."],"tags":["skill","validation","namespace","ai"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}