alibaba/nacos · error · IllegalArgumentException

Request parameter `name` should not be null or empty.

Error message

Request parameter `name` should not be null or empty.

What it means

AgentSpecNameHttpResourceParser resolves the authz target from the HTTP 'name' parameter for AgentSpec operations keyed by name (lookup/delete). A blank name makes resource-scoped authorization impossible, so it throws IllegalArgumentException.

Source

Thrown at auth/src/main/java/com/alibaba/nacos/auth/parser/http/AgentSpecNameHttpResourceParser.java:35

package com.alibaba.nacos.auth.parser.http;

import com.alibaba.nacos.common.utils.StringUtils;
import jakarta.servlet.http.HttpServletRequest;

/**
 * AgentSpec HTTP resource parser that resolves the target from the client {@code name} parameter.
 *
 * @author xiweng.yy
 */
public class AgentSpecNameHttpResourceParser extends AiHttpResourceParser {
    
    private static final String AGENT_SPEC_NAME_PARAM = "name";
    
    @Override
    protected String getResourceName(HttpServletRequest request) {
        String agentSpecName = request.getParameter(AGENT_SPEC_NAME_PARAM);
        if (StringUtils.isBlank(agentSpecName)) {
            throw new IllegalArgumentException(
                "Request parameter `name` should not be null or empty.");
        }
        return agentSpecName;
    }
}

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Include a non-blank name parameter in the request.
  2. Validate name is selected/present before issuing the request from the UI.

Example fix

// before
curl -X DELETE 'http://nacos:8848/v3/admin/ai/agent/spec'  # no name -> 558

// after
curl -X DELETE 'http://nacos:8848/v3/admin/ai/agent/spec?name=my-agent'
Defensive patterns

Strategy: validation

Validate before calling

String name = request.getParameter("name");
if (StringUtils.isBlank(name)) {
    return Result.failure("name is required");
}

Prevention

When it happens

Trigger: Calling an AgentSpec name-keyed HTTP API (e.g. get/delete by name) without the name query/form parameter.

Common situations: Console action with no selection; script deleting by name but the variable was empty; parameter shadowed by content-type handling.

Related errors


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