alibaba/nacos · error · IllegalArgumentException

Agent create input must not contain read-only projection fie

Error message

Agent create input must not contain read-only projection fields

What it means

Error "Agent create input must not contain read-only projection fields" thrown in alibaba/nacos.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1027

        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");
        }
        if (initialVersion.getNamespaceId() != null
            && !agent.getNamespaceId().equals(initialVersion.getNamespaceId())) {
            throw new IllegalArgumentException("initialVersion namespaceId does not match Agent");
        }
        if (initialVersion.getAgentName() != null
            && !agent.getAgentName().equals(initialVersion.getAgentName())) {
            throw new IllegalArgumentException("initialVersion agentName does not match Agent");
        }
        if (initialVersion.getStatus() != null
            && !expectedStatus.equals(initialVersion.getStatus())) {
            throw new IllegalArgumentException("initialVersion status must be " + expectedStatus);

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Review the input and runtime state for agent create read-only fields, correct the reported problem, and retry.

When it happens

Trigger: Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1027 when the library encounters an invalid state.

Common situations: Agent create input contains read-only projection fields that only the server may set.


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/d749a761e83d771b. Report an issue: GitHub.