{"record":{"id":"ca591b7f43cf2cee","repo":"alibaba/nacos","slug":"20002-ca591b","errorCode":"20002","errorMessage":"Request parameter `autoSubmit` must be `true` or `false`.","messagePattern":"Request parameter `autoSubmit` must be `true` or `false`\\.","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agent/client/AgentPublishForm.java","lineNumber":89,"sourceCode":"        return result;\n    }\n    \n    public String getAutoSubmit() {\n        return autoSubmit;\n    }\n    \n    public void setAutoSubmit(String autoSubmit) {\n        this.autoSubmit = autoSubmit;\n    }\n    \n    private boolean parseAutoSubmit() throws NacosApiException {\n        if (Boolean.TRUE.toString().equalsIgnoreCase(autoSubmit)) {\n            return true;\n        }\n        if (Boolean.FALSE.toString().equalsIgnoreCase(autoSubmit)) {\n            return false;\n        }\n        throw new NacosApiException(NacosException.INVALID_PARAM,\n            ErrorCode.PARAMETER_VALIDATE_ERROR,\n            \"Request parameter `autoSubmit` must be `true` or `false`.\");\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":94,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agent/client/AgentPublishForm.java#L71-L94","documentation":"Thrown by AgentValidationUtils.validateEndpointMetadata when the Endpoint metadata map has more than 32 entries (MAX_METADATA_SIZE). The cap is on entry count, before per-key/per-value checks run. Metadata is optional (null returns cleanly), but a non-null map is size-bounded.","triggerScenarios":"Registering/canonicalizing an Endpoint whose metadata map has 33+ entries. Callers: EndpointCanonicalizer.canonicalize (line 77 via validateEndpointMetadata), AgentRuntimeEndpointMapper (line 345), RadModelValidator.validateResolveFilter (line 234, metadataSelector).","commonSituations":"Copying the full Kubernetes pod labels/annotations (often >32) into Endpoint metadata; propagating all tracing labels; a bug that duplicates keys across merges raising effective count.","solutions":["Keep Endpoint metadata to <=32 entries; select only the labels relevant to routing.","Drop internal/system labels before submitting (they may also collide with reserved keys).","If you need more, move bulk data out of metadata into your descriptor payload."],"exampleFix":"// before\nendpoint.setMetadata(allPodLabels); // 40 entries\n// after\nMap<String,String> picked = new LinkedHashMap<>();\nallPodLabels.entrySet().stream().filter(e -> e.getKey().startsWith(\"app.\")).limit(32).forEach(e -> picked.put(e.getKey(), e.getValue()));\nendpoint.setMetadata(picked);","handlingStrategy":"validation","validationCode":"if (metadata != null && metadata.size() > 32) {\n    throw new IllegalArgumentException(\"Endpoint metadata exceeds 32 entries\");\n}","typeGuard":"static boolean metadataWithinSize(Map<String,String> m) {\n    return m == null || m.size() <= 32;\n}","tryCatchPattern":"try {\n    AgentValidationUtils.validateEndpointMetadata(metadata);\n} catch (IllegalArgumentException e) {\n    // return 400, metadata too large\n}","preventionTips":["Select only routing-relevant labels for Endpoint metadata.","Avoid dumping all pod labels/annotations into metadata."],"tags":["ai-agent","validation","metadata","endpoint","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}