XTLS/Xray-core · warning
failed to transport all UDP response
Error message
failed to transport all UDP response
What it means
Thrown when relaying the Shadowsocks server's UDP responses back to the client (UDPReader → link.Writer) fails. UDPReader must decrypt and parse each framed packet; a decrypt failure, malformed packet, or closed inbound writer surfaces here. Frequently paired with [623]; both sharing a cause indicates a broken UDP path, while this one alone suggests a server-side or parsing problem.
Source
Thrown at proxy/shadowsocks/client.go:181
Request: request,
}
if err := buf.Copy(link.Reader, writer, buf.UpdateActivity(timer)); err != nil {
return errors.New("failed to transport all UDP request").Base(err)
}
return nil
}
responseDone := func() error {
defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly)
reader := &UDPReader{
Reader: conn,
User: user,
}
if err := buf.Copy(reader, link.Writer, buf.UpdateActivity(timer)); err != nil {
return errors.New("failed to transport all UDP response").Base(err)
}
return nil
}
responseDoneAndCloseWriter := task.OnSuccess(responseDone, task.Close(link.Writer))
if err := task.Run(ctx, requestDone, responseDoneAndCloseWriter); err != nil {
return errors.New("connection ends").Base(err)
}
return nil
}
return nil
}
func init() {
common.Must(common.RegisterConfig((*ClientConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
return NewClient(ctx, config.(*ClientConfig))View on GitHub (pinned to 7d214f8b09)
Solutions
- Verify password, method, and (for 2022) PSK identity match on both ends — response decrypt failure is the classic mismatch symptom.
- Restart the client session (or Xray) so client and server nonce/counters resynchronize.
- Check whether the server restarted mid-session; stale sessions cannot decrypt new-server responses.
- If persistent, capture one failing exchange and compare with a known-good client implementation.
Defensive patterns
Strategy: try-catch
Try / catch
if err := buf.Copy(reader, link.Writer, buf.UpdateActivity(timer)); err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, io.EOF) {
return nil
}
return errors.New("failed to transport all UDP response").Base(err)
} Prevention
- Restart sessions (or Xray) after server restarts to resync AEAD counters.
- Keep credentials in sync via config management instead of manual edits.
- Alert on repeated decrypt failures — they signal key drift, not network noise.
When it happens
Trigger: buf.Copy from UDPReader to link.Writer returns an error: AEAD decryption of a response packet fails (key/nonce desync), packet framing from the server is malformed, or the client-side link writer was closed.
Common situations: Server and client cipher/password mismatch that only manifests on responses; server implementation sending non-2022 framing to a 2022-aware client; concurrent reuse of one UDP session by multiple destinations after a server restart.
Related errors
- failed to transport all UDP request
- connection ends
- failed to write request
- failed to write A request payload
- unexpected EOF
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/318b73dc2d835aa8.
Report an issue: GitHub.