alibaba/nacos · error · IllegalArgumentException
Agent Resource source must not be blank
Error message
Agent Resource source must not be blank
What it means
Error "Agent Resource source must not be blank" thrown in alibaba/nacos.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:139
public AgentVersionDetail createInitialDraft(Agent agent, AgentVersionDetail initialDraft)
throws NacosException {
return createInitialVersion(agent, initialDraft, AiConstants.Agent.VERSION_STATUS_DRAFT,
RESOURCE_SOURCE_LOCAL);
}
/**
* Create the first online Agent Version for a compatibility facade.
*
* @param agent writable Agent Resource fields
* @param initialVersion initial online Version definition
* @param resourceSource persisted Resource source marker
* @return persisted and storage-verified first online Version
* @throws NacosException when persistence or AI Storage fails
*/
AgentVersionDetail createInitialOnlineVersion(Agent agent,
AgentVersionDetail initialVersion, String resourceSource) throws NacosException {
if (StringUtils.isBlank(resourceSource)) {
throw new IllegalArgumentException("Agent Resource source must not be blank");
}
return createInitialVersion(agent, initialVersion,
AiConstants.Agent.VERSION_STATUS_ONLINE, resourceSource);
}
private AgentVersionDetail createInitialVersion(Agent agent,
AgentVersionDetail initialVersion, String status, String resourceSource)
throws NacosException {
validateCreateInputs(agent, initialVersion, status);
Map<String, List<String>> onlineVersionProtocols =
Collections.<String, List<String>>emptyMap();
Map<String, String> labels = Collections.<String, String>emptyMap();
if (AiConstants.Agent.VERSION_STATUS_ONLINE.equals(status)) {
onlineVersionProtocols = new LinkedHashMap<String, List<String>>();
onlineVersionProtocols.put(initialVersion.getVersion(),
protocolNames(initialVersion.getCallInterfaces()));
labels = new LinkedHashMap<String, String>();
labels.put(AiResourceConstants.LABEL_LATEST, initialVersion.getVersion());View on GitHub (pinned to 9b989acdf1)
Solutions
- Review the input and runtime state for agent resource source, correct the reported problem, and retry.
When it happens
Trigger: Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:139 when the library encounters an invalid state.
Common situations: Persisting an Agent whose resource source field is blank.
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/ffd9997b7c071dd6.
Report an issue: GitHub.