alibaba/nacos · error · Error
transport must contain 1 to 64 letters, digits, +, or -
Error message
transport must contain 1 to 64 letters, digits, +, or -
What it means
validateTransport requires the transport identifier to match `^[0-9A-Za-z+\-]{1,64}$`: one to sixty-four characters of ASCII letters, digits, plus, or hyphen only. Throws when the value is empty (caught first by `required`), or contains spaces, underscores, slashes, or exceeds 64 chars.
Source
Thrown at console-ui-next/src/pages/newAgent/agent-console-model.ts:138
const withoutTrailingCommas = value.replace(
/("(?:\\.|[^"\\])*")|,\s*([}\]])/g,
(match, quoted, closing) => quoted || closing || match,
);
return parseJson(withoutTrailingCommas, 'agentCard');
}
function isObject(value: unknown): value is Record<string, unknown> {
return value !== null && !Array.isArray(value) && typeof value === 'object';
}
function optionalString(value: unknown): string | undefined {
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
}
function validateTransport(value: string): string {
const transport = required(value, 'transport');
if (!/^[0-9A-Za-z+-]{1,64}$/.test(transport)) {
throw new Error('transport must contain 1 to 64 letters, digits, +, or -');
}
return transport;
}
function endpointKey(uri: string, transport: string): string {
let parsed: URL;
try {
parsed = new URL(uri);
} catch {
throw new Error(`Invalid Endpoint URI: ${uri}`);
}
if (!parsed.protocol || !parsed.hostname || parsed.username || parsed.password || parsed.hash) {
throw new Error(`Invalid Endpoint URI: ${uri}`);
}
let port = parsed.port;
if (!port) {
if (parsed.protocol === 'http:' || parsed.protocol === 'ws:') {
port = '80';View on GitHub (pinned to 9b989acdf1)
Solutions
- Use a short alphanumeric token, e.g. 'GRPC', 'HTTP', 'A2A', 'WSS'.
- Encode versions without slashes/dots: 'A2A-V2' instead of 'A2A/V2'.
- Trim the input and reject it client-side before submit with the same regex.
Example fix
// before transport = 'a2a/v2 streaming' // after transport = 'A2A-V2'
Defensive patterns
Strategy: validation
Validate before calling
const TRANSPORT_RE = /^[0-9A-Za-z+-]{1,64}$/;
function checkTransport(v) { if (!TRANSPORT_RE.test(v)) throw new Error('transport format invalid'); } Type guard
function isValidTransport(v: string): boolean {
return /^[0-9A-Za-z+-]{1,64}$/.test(v);
} Try / catch
try { validateTransport(t); } catch (e) {
if (/transport must contain/.test(e.message)) { toast.error('Use letters, digits, + or - only (max 64)'); }
} Prevention
- Constrain input with a pattern attribute
- Trim whitespace
- Avoid slashes/underscores in transport names
When it happens
Trigger: User enters a transport like 'GRPC + HTTP' (space), 'a2a/v2' (slash), 'streaming_rpc' (underscore), or a name longer than 64 characters. Common transports are 'GRPC', 'HTTP', 'A2A', 'WS'.
Common situations: User treats transport as a free-form label. Including a version suffix with a slash or dot. Copy-paste introducing a trailing newline or space.
Related errors
- transport must contain 1 to 64 letters, digits, +, or -
- 10000
- 20002
- The number of capturing groups in the pattern segment {patte
- protocol must be unique: ${callInterface.protocol}
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/5902041c83cbf3b9.
Report an issue: GitHub.