alibaba/nacos · error · IllegalArgumentException
Agent draft namespaceId does not match request
Error message
Agent draft namespaceId does not match request
What it means
Error "Agent draft namespaceId does not match request" thrown in alibaba/nacos.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:779
if (resourcePersistService.updateMetaCas(namespaceId, agentName,
Constants.Agent.RESOURCE_TYPE_AGENT, meta.getMetaVersion(), updateValue)) {
return getAgent(namespaceId, agentName);
}
}
throw conflict("Agent lifecycle metadata changed concurrently: " + agentName, null);
}
private void validateSubsequentDraftInputs(String namespaceId, String agentName,
AgentVersionDetail draft, String basedOnVersion) {
AgentValidationUtils.validateNamespaceId(namespaceId);
AgentValidationUtils.validateAgentName(agentName);
if (draft == null) {
throw new IllegalArgumentException("Agent draft must not be null");
}
AgentValidationUtils.validateVersion(draft.getVersion());
if (draft.getNamespaceId() != null
&& !namespaceId.equals(draft.getNamespaceId())) {
throw new IllegalArgumentException("Agent draft namespaceId does not match request");
}
if (draft.getAgentName() != null && !agentName.equals(draft.getAgentName())) {
throw new IllegalArgumentException("Agent draft agentName does not match request");
}
if (draft.getStatus() != null
&& !AiConstants.Agent.VERSION_STATUS_DRAFT.equals(draft.getStatus())) {
throw new IllegalArgumentException("Agent draft status must be draft");
}
if (draft.getContentDigest() != null || draft.getCreateTime() != null
|| draft.getUpdateTime() != null) {
throw new IllegalArgumentException(
"Agent draft must not contain read-only projection fields");
}
boolean directContent = draft.getCallInterfaces() != null;
boolean copiedContent = StringUtils.isNotBlank(basedOnVersion);
if (directContent == copiedContent) {
throw new IllegalArgumentException(
"Agent draft must contain either callInterfaces or basedOnVersion");View on GitHub (pinned to 9b989acdf1)
Solutions
- Review the input and runtime state for agent draft namespaceId, correct the reported problem, and retry.
When it happens
Trigger: Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:779 when the library encounters an invalid state.
Common situations: Submitting a draft whose namespaceId differs from the request namespace.
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/e97310673ae43b1b.
Report an issue: GitHub.