vitessio/vitess · error

detailed_limit %v exceeds maximum allowed value %v

Error message

detailed_limit %v exceeds maximum allowed value %v

What it means

Analogous to the Limit check, GetBackups validates req.DetailedLimit (used when returning detailed backup metadata) against maxBackupLimit. Values above the cap are rejected before computing detailed backup info.

Source

Thrown at go/vt/vtctl/grpcvtctldserver/server.go:1562

	bhs, err := bs.ListBackups(ctx, bucket)
	if err != nil {
		return nil, err
	}

	totalBackups := len(bhs)
	if req.Limit > 0 {
		if req.Limit > maxBackupLimit {
			return nil, fmt.Errorf("limit %v exceeds maximum allowed value %v", req.Limit, maxBackupLimit)
		}
		if int(req.Limit) < totalBackups {
			totalBackups = int(req.Limit)
		}
	}

	totalDetailedBackups := len(bhs)
	if req.DetailedLimit > 0 {
		if req.DetailedLimit > maxBackupLimit {
			return nil, fmt.Errorf("detailed_limit %v exceeds maximum allowed value %v", req.DetailedLimit, maxBackupLimit)
		}
		if int(req.DetailedLimit) < totalDetailedBackups {
			totalDetailedBackups = int(req.DetailedLimit)
		}
	}

	backups := make([]*mysqlctlpb.BackupInfo, 0, totalBackups)
	backupsToSkip := len(bhs) - totalBackups
	backupsToSkipDetails := len(bhs) - totalDetailedBackups

	for i, bh := range bhs {
		if i < backupsToSkip {
			continue
		}

		bi := mysqlctlproto.BackupHandleToProto(bh)
		bi.Keyspace = req.Keyspace
		bi.Shard = req.Shard

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Lower DetailedLimit to at most maxBackupLimit
  2. Omit DetailedLimit (<= 0) when full detail is not needed
  3. Page through detailed results in multiple calls if more detail is required

Example fix

// before
req.DetailedLimit = math.MaxInt32
// after
req.DetailedLimit = 1000
Defensive patterns

Strategy: validation

Validate before calling

const maxBackupLimit = 10000
if req.DetailedLimit > 0 && req.DetailedLimit > maxBackupLimit {
    return fmt.Errorf("detailed_limit %d exceeds cap", req.DetailedLimit)
}

Try / catch

_, err := client.GetBackups(ctx, req)
if err != nil && strings.Contains(err.Error(), "detailed_limit") {
    req.DetailedLimit = 0 // or a value within the cap
}

Prevention

When it happens

Trigger: Calling GetBackups with DetailedLanguage/DetailedLimit set to a value greater than maxBackupLimit when detailed backup metadata is requested.

Common situations: Same as the Limit case: sentinel MaxInt values from generic pagination code, or clients unaware of the server-side cap.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/d9a3029d16187212. Report an issue: GitHub.