alibaba/nacos · error · NacosApiException

20002

20002

Error message

Required parameter 'resourceType' is missing

What it means

Thrown by PipelineListForm.validate() when resourceType is blank. This guards the pipeline-execution listing endpoint; resourceType scopes the query (e.g. MCP, PROMPT, AGENTSPEC). Uses code 20002 (PARAMETER_VALIDATE_ERROR), HTTP 400. The form also accepts optional resourceName, namespaceId, version.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/pipeline/PipelineListForm.java:48

 * @since 3.2.0
 */
public class PipelineListForm implements NacosForm {
    
    @Serial
    private static final long serialVersionUID = 1L;
    
    private String resourceType;
    
    private String resourceName;
    
    private String namespaceId;
    
    private String version;
    
    @Override
    public void validate() throws NacosApiException {
        if (StringUtils.isBlank(resourceType)) {
            throw new NacosApiException(NacosApiException.INVALID_PARAM,
                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "Required parameter 'resourceType' is missing");
        }
    }
    
    public String getResourceType() {
        return resourceType;
    }
    
    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }
    
    public String getResourceName() {
        return resourceName;
    }
    
    public void setResourceName(String resourceName) {

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Add resourceType to the GET request (a known AI resource type).
  2. Pair it with resourceName to narrow results.
  3. If listing all pipelines is needed, confirm whether the API supports a wildcard — otherwise scope by resourceType.

Example fix

// before
curl 'http://host/v3/admin/ai/pipelines/list'
// after
curl 'http://host/v3/admin/ai/pipelines/list?resourceType=MCP&resourceName=myMcp'
Defensive patterns

Strategy: validation

Validate before calling

if (resourceType == null || resourceType.trim().isEmpty()) {
    throw new IllegalArgumentException("resourceType required");
}

Type guard

static boolean hasResourceType(String t) {
    return t != null && !t.trim().isEmpty();
}

Try / catch

catch (NacosApiException e) {
    if (e.getErrCode() == 20002 && e.getMessage().contains("resourceType")) { /* supply type */ }
}

Prevention

When it happens

Trigger: Calling GET /v3/admin/ai/pipelines/list without the resourceType query parameter.

Common situations: Client builds the list query from an empty filter state; resourceType sourced from a dropdown that defaulted to blank; refactoring dropped the field.

Related errors


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