XTLS/Xray-core · error
No available name server could be created from
Error message
No available name server could be created from
What it means
The peer's padding record length (decoded varint) is rejected by readPaddingTurn when it is smaller than its own header length or exceeds maxPaddingTurnLength (8 MiB). This guards against absurd allocations and detects peers speaking a different or corrupted protocol: a legit record is always at least headerLength bytes and at most 8 MiB.
Source
Thrown at app/dns/nameserver.go:87
return NewTCPLocalNameServer(u, disableCache, serveStale, serveExpiredTTL, clientIP)
case strings.EqualFold(u.String(), "fakedns"):
var fd dns.FakeDNSEngine
err = core.RequireFeatures(ctx, func(fdns dns.FakeDNSEngine) {
fd = fdns
})
if err != nil {
return nil, err
}
return NewFakeDNSServer(fd), nil
}
}
if dest.Network == net.Network_Unknown {
dest.Network = net.Network_UDP
}
if dest.Network == net.Network_UDP { // UDP classic DNS mode
return NewClassicNameServer(dest, dispatcher, disableCache, serveStale, serveExpiredTTL, clientIP), nil
}
return nil, errors.New("No available name server could be created from ", dest).AtWarning()
}
// NewClient creates a DNS client managing a name server with client IP, domain rules and expected IPs.
func NewClient(
ctx context.Context,
ns *NameServer,
clientIP net.IP,
disableCache bool, serveStale bool, serveExpiredTTL uint32,
tag string,
ipOption dns.IPOption,
updateRules func(bool),
) (*Client, error) {
client := &Client{}
err := core.RequireFeatures(ctx, func(dispatcher routing.Dispatcher) error {
// Create a new server for each client for now
server, err := NewServer(ctx, ns.Address.AsDestination(), dispatcher, disableCache, serveStale, serveExpiredTTL, clientIP)
if err != nil {
return errors.New("failed to create nameserver").Base(err).AtWarning()View on GitHub (pinned to 7d214f8b09)
Solutions
- Confirm the remote address actually serves the XMC transport with padding enabled
- Align client/server versions so maxPaddingTurnLength matches on both ends
- Treat as fatal for the connection; reconnect and re-run the schedule
Defensive patterns
Strategy: try-catch
Try / catch
if err != nil && strings.Contains(err.Error(), "invalid padding record length") {
// almost certainly not an XMC padding peer or a corrupted stream; abort and alert
} Prevention
- Point the transport only at endpoints running matching XMC versions
- Keep maxPaddingTurnLength identical across versions during rollouts
When it happens
Trigger: Connecting to a service that is not an XMC padding peer (its first bytes decode to a huge varint); stream corruption mid-handshake; a forked peer with a different max turn length.
Common situations: Wrong inbound port behind a reverse proxy pointing at a plain HTTP/TLS backend; version skew where one side allows > 8 MiB turns; bit-level corruption on flaky links.
Related errors
- not a Service.
- Dispatcher: Invalid destination.
- FakeDNSEngine is not initialized, but such a sniffer is used
- Failed to convert address to Net IP.
- unexpected client IP length
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/a9ac767bb603b1c0.
Report an issue: GitHub.