gravitational/teleport · warning

unhandled size name: %v

Error message

unhandled size name: %v

What it means

parseBytes only understands a fixed set of unit suffixes (b, k/kb/ki/kib, m/mb/mi/mib, g/gb/gi/gib, case-insensitive, or a bare number for bytes). If the text after the leading digits is not in bytesSizeTable, the suffix is unknown and the error 'unhandled size name' is returned. Note it does NOT support tb, pb, or full-word units like 'megabytes'.

Source

Thrown at api/utils/grpc/size.go:88

	var value float32
	if f, err := strconv.ParseFloat(num, 32); err == nil {
		value = float32(f)
	} else {
		return 0, err

	}

	extra := strings.ToLower(strings.TrimSpace(s[lastDigit:]))
	if m, ok := bytesSizeTable[extra]; ok {
		value *= float32(m)
		if value >= math.MaxInt32 {
			return 0, fmt.Errorf("too large: %v", s)
		}
		return int(value), nil
	}

	return 0, fmt.Errorf("unhandled size name: %v", extra)
}

// MaxClientRecvMsgSize returns maximum message size in bytes the client can receive.
//
// By default 4MB is returned, to overwrite this, set `TELEPORT_UNSTABLE_GRPC_RECV_SIZE` envriroment
// variable. If the value cannot be parsed or exceeds int32 limits, the default value is returned.
//
// The result of this call can be passed directly into `grpc.MaxCallRecvMsgSize`, example:
//
//	conn, err := grpc.DialContext(ctx, target,
//		grpc.WithDefaultCallOptions(
//			grpc.MaxCallRecvMsgSize(grpcutils.MaxClientRecvMsgSize()),
//		),
//	)
func MaxClientRecvMsgSize() int {

	val := os.Getenv("TELEPORT_UNSTABLE_GRPC_RECV_SIZE")
	if val == "" {

View on GitHub (pinned to 1283425b60)

Solutions

  1. Use only supported units: b, k/kb/ki/kib, m/mb/mi/mib, g/gb/gi/gib (e.g. '32mib')
  2. Remove the env var to fall back to the 4MB default
  3. Check the exact value with: echo $TELEPORT_UNSTABLE_GRPC_RECV_SIZE and fix typos in the unit suffix

Example fix

// before
export TELEPORT_UNSTABLE_GRPC_RECV_SIZE=64Mi
// after
export TELEPORT_UNSTABLE_GRPC_RECV_SIZE=64mib
Defensive patterns

Strategy: validation

Validate before calling

var sizeUnits = map[string]bool{"": true, "b": true, "k": true, "ki": true, "kb": true, "kib": true, "m": true, "mi": true, "mb": true, "mib": true, "g": true, "gi": true, "gb": true, "gib": true}
func validSizeSuffix(v string) bool {
	v = strings.ToLower(strings.TrimSpace(v))
	i := 0
	for i < len(v) && (v[i] >= '0' && v[i] <= '9' || v[i] == '.') {
		i++
	}
	return sizeUnits[strings.TrimSpace(v[i:])]
}

Try / catch

if !validSizeSuffix(val) { return fmt.Errorf("unsupported unit in %q; use b/k/kb/kib/m/mb/mib/g/gb/gib", val) }

Prevention

When it happens

Trigger: TELEPORT_UNSTABLE_GRPC_RECV_SIZE set to values with unsupported suffixes such as '100tb', '64MBytes', '1 MB' with the space included in the suffix after trimming (space is trimmed, but 'megs'/'terabyte' style units fail), or a typo like '100mibb'.

Common situations: Operators accustomed to Kubernetes quantity syntax ('128Mi', '1Ti') set '1ti' or use 't'/'tb' which are not in the table; the error is silently swallowed and the 4MB default is silently used.

Related errors


AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02). Data as JSON: /api/errors/2a046fc6d54700e5. Report an issue: GitHub.