alibaba/nacos · error · IllegalArgumentException
Agent must not be null
Error message
Agent must not be null
What it means
Error "Agent must not be null" thrown in alibaba/nacos.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1016
String changeDescription) {
AgentVersionDetail target = new AgentVersionDetail();
target.setNamespaceId(currentRow.getNamespaceId());
target.setAgentName(currentRow.getName());
target.setVersion(currentRow.getVersion());
target.setStatus(AiConstants.Agent.VERSION_STATUS_DRAFT);
target.setCallInterfaces(callInterfaces);
target.setAuthor(currentRow.getAuthor());
target.setChangeDescription(changeDescription);
target.setContentDigest(targetDescriptor.getContentDigest());
target.setCreateTime(0L);
target.setUpdateTime(0L);
AgentModelValidator.validateVersionDetail(target);
}
private void validateCreateInputs(Agent agent, AgentVersionDetail initialVersion,
String expectedStatus) {
if (agent == null) {
throw new IllegalArgumentException("Agent must not be null");
}
if (initialVersion == null) {
throw new IllegalArgumentException("initialVersion must not be null");
}
AgentValidationUtils.validateNamespaceId(agent.getNamespaceId());
AgentValidationUtils.validateAgentName(agent.getAgentName());
AgentValidationUtils.validateVersion(initialVersion.getVersion());
if (agent.getVersionInfo() != null || agent.getVersionCatalog() != null
|| agent.getMetaVersion() != null || agent.getCreateTime() != null
|| agent.getUpdateTime() != null) {
throw new IllegalArgumentException(
"Agent create input must not contain read-only projection fields");
}
if (initialVersion.getContentDigest() != null || initialVersion.getCreateTime() != null
|| initialVersion.getUpdateTime() != null) {
throw new IllegalArgumentException(
"initialVersion must not contain read-only projection fields");
}View on GitHub (pinned to 9b989acdf1)
Solutions
- Provide a non-null value for agent create input before invoking this operation.
When it happens
Trigger: Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1016 when the library encounters an invalid state.
Common situations: Calling agent creation with a null Agent object.
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/ba31256ca73301bf.
Report an issue: GitHub.