tailscale/tailscale · error

'size' parameter is only supported with disco pings

Error message

'size' parameter is only supported with disco pings

What it means

The ping handler got a non-zero 'size' parameter together with a ping 'type' other than disco. Only magicsock disco pings carry a configurable payload size, so a size with TSMP/ICMP/peerapi pings is rejected with 400 rather than silently ignored.

Source

Thrown at ipn/localapi/localapi.go:1293

	if err != nil {
		http.Error(w, "invalid IP", http.StatusBadRequest)
		return
	}
	pingTypeStr := r.FormValue("type")
	if pingTypeStr == "" {
		http.Error(w, "missing 'type' parameter", http.StatusBadRequest)
		return
	}
	size := 0
	sizeStr := r.FormValue("size")
	if sizeStr != "" {
		size, err = strconv.Atoi(sizeStr)
		if err != nil {
			http.Error(w, "invalid 'size' parameter", http.StatusBadRequest)
			return
		}
		if size != 0 && tailcfg.PingType(pingTypeStr) != tailcfg.PingDisco {
			http.Error(w, "'size' parameter is only supported with disco pings", http.StatusBadRequest)
			return
		}
		if size > magicsock.MaxDiscoPingSize {
			http.Error(w, fmt.Sprintf("maximum value for 'size' is %v", magicsock.MaxDiscoPingSize), http.StatusBadRequest)
			return
		}
	}
	res, err := h.b.Ping(ctx, ip, tailcfg.PingType(pingTypeStr), size)
	if err != nil {
		WriteErrorJSON(w, err)
		return
	}
	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(res)
}

func (h *Handler) serveDial(w http.ResponseWriter, r *http.Request) {
	if r.Method != httpm.POST {

View on GitHub (pinned to 6e0912f979)

Solutions

  1. Set type=disco when using the size parameter
  2. Omit size for other ping types
  3. Check for accidental default size values in the client
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ipn/localapi/localapi.go:1293 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tailscale/tailscale@6e0912f979 (2026-08-18). Data as JSON: /api/errors/0ec394333f049cd4. Report an issue: GitHub.