alibaba/nacos · warning · Error
${name} is required
Error message
${name} is required What it means
Thrown by the agent-console-model required() helper when a value is null, undefined, empty, or whitespace-only after trimming. This is the shared guard for mandatory string fields across agent draft creation, A2A card projection, and call-interface serialization. The error embeds the field name (e.g. 'agentName', 'version', 'transport', 'AgentCard name').
Source
Thrown at console-ui/src/pages/AI/agent-console-model.js:56
export const DEFAULT_CALL_INTERFACES = JSON.stringify(
[
{
protocol: 'custom',
protocolVersion: '1.0.0',
descriptorMediaType: 'application/json',
nativeDescriptor: {},
endpointSourceOrder: ['RUNTIME', 'DECLARED'],
declaredEndpoints: [],
},
],
null,
2
);
function required(value, name) {
const result = String(value || '').trim();
if (!result) {
throw new Error(`${name} is required`);
}
return result;
}
function parseJson(value, name) {
try {
return JSON.parse(value);
} catch (e) {
throw new Error(`${name} must be valid JSON`);
}
}
function parseAgentCardJson(value) {
const withoutTrailingCommas = value.replace(
/("(?:\\.|[^"\\])*")|,\s*([}\]])/g,
(match, quoted, closing) => quoted || closing || match
);
return parseJson(withoutTrailingCommas, 'agentCard');View on GitHub (pinned to 9b989acdf1)
Solutions
- Read the field name in the message and fill in that required field.
- For AgentCard projection, ensure the JSON includes non-empty 'name' and 'version' (or pass a fallback version).
- For transport, ensure a protocol binding like 'HTTP' or 'GRPC' is selected.
Example fix
// before values.agentName = ''; // after values.agentName = 'my-agent';
Defensive patterns
Strategy: validation
Validate before calling
function assertRequired(value, name) {
const result = String(value || '').trim();
if (!result) throw new Error(`${name} is required`);
return result;
} Type guard
function isNonEmptyString(v) {
return typeof v === 'string' && v.trim().length > 0;
} Try / catch
try {
buildDraftCreateData(namespaceId, values, initial, contentMode, protocolEditors);
} catch (e) {
Message.error(e.message); // e.g. 'agentName is required'
return;
} Prevention
- Mark required fields in the UI with a visible asterisk and disable submit until filled.
- Run required() checks on blur for immediate feedback.
- Seed default values (e.g. version '1.0.0') to reduce blank submissions.
When it happens
Trigger: Submitting an agent form with a blank required field: agentName, version, basedOnVersion, transport, AgentCard interface url, AgentCard interface protocolVersion, callInterfaces, or agentCard text.
Common situations: User leaves the agent name or version empty, pastes an AgentCard JSON missing the 'name' field, or a structured protocol editor with an empty transport.
Related errors
- Labels must be a JSON object
- The latest label is managed by the server
- ${name} must be valid JSON
- transport must contain 1 to 64 letters, digits, +, or -
- Invalid Endpoint URI: ${uri}
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/4ba93f7db2313704.
Report an issue: GitHub.