alibaba/nacos · warning · Error
at least one protocol is required
Error message
at least one protocol is required
What it means
Thrown by serializeCallInterfaces() in agent-console-model when structured protocol editors are supplied (protocolEditors is truthy) but the array is empty. At least one call interface is mandatory for an agent version using direct content mode.
Source
Thrown at console-ui/src/pages/AI/agent-console-model.js:311
}
function validateUniqueProtocols(callInterfaces) {
const protocols = new Set();
callInterfaces.forEach(callInterface => {
if (protocols.has(callInterface.protocol)) {
throw new Error(`protocol must be unique: ${callInterface.protocol}`);
}
protocols.add(callInterface.protocol);
});
return callInterfaces;
}
function serializeCallInterfaces(values, protocolEditors) {
const agentName = required(values.agentName, 'agentName');
const version = required(values.version, 'version');
if (protocolEditors) {
if (protocolEditors.length === 0) {
throw new Error('at least one protocol is required');
}
return JSON.stringify(
validateUniqueProtocols(
protocolEditors.map(editor => buildStructuredCallInterface(agentName, version, editor))
)
);
}
if (values.protocolEditorKind === 'a2a' || values.protocolEditorKind === 'custom') {
return JSON.stringify([
buildStructuredCallInterface(agentName, version, editorFromValues(values)),
]);
}
const parsed = parseJson(required(values.callInterfaces, 'callInterfaces'), 'callInterfaces');
if (!Array.isArray(parsed) || parsed.length === 0) {
throw new Error('callInterfaces must be a non-empty JSON array');
}
return JSON.stringify(parsed);
}View on GitHub (pinned to 9b989acdf1)
Solutions
- Add at least one protocol editor row (a2a or custom) before saving.
- If you do not want call interfaces, switch the content mode away from 'direct'.
- Restore the default protocol editor via createStructuredProtocolEditor().
Example fix
// before
protocolEditors = [];
// after
protocolEditors = [createStructuredProtocolEditor('a2a', DEFAULT_AGENT_CARD)]; Defensive patterns
Strategy: validation
Validate before calling
function hasAtLeastOneProtocol(editors) {
return Array.isArray(editors) && editors.length > 0;
} Try / catch
try {
serializeCallInterfaces(values, protocolEditors);
} catch (e) {
Message.error(e.message); // 'at least one protocol is required'
return;
} Prevention
- Disable submit when the protocol editor list is empty.
- Seed one default protocol editor on form open.
- Warn before allowing the last protocol row to be removed.
When it happens
Trigger: Saving an agent draft in direct content mode after deleting all protocol editor rows, leaving zero protocols.
Common situations: User removes every protocol entry intending to add none, or a UI state bug yields an empty editor array.
Related errors
- protocol must be unique: ${callInterface.protocol}
- providerName is required when providerUrl is set
- at least one protocol is required
- Labels must be a JSON object
- The latest label is managed by the server
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/7db7993178b3c32f.
Report an issue: GitHub.