t8y2/dbx · error

unsupported reset position: %s

Error message

unsupported reset position: %s

What it means

Returned by resetConsumerGroupOffsets in the rocketmq driver when the 'position' parameter is not one of earliest, latest, or timestamp (case-insensitive; defaults to latest when empty). Any other value reaches the switch default and is rejected before the reset RPC is issued.

Source

Thrown at agents/drivers/rocketmq/consumers.go:252

				return nil, err
			}
		}
		return okResult(), nil
	}
	position := strings.ToLower(stringValue(params, "position"))
	if position == "" {
		position = "latest"
	}
	var timestamp int64
	switch position {
	case "earliest":
		timestamp = 0
	case "latest":
		timestamp = time.Now().UnixMilli()
	case "timestamp":
		timestamp = int64Value(params, time.Now().UnixMilli(), "timestampMs")
	default:
		return nil, fmt.Errorf("unsupported reset position: %s", position)
	}
	if _, err := client.ResetOffsetByTimestamp(ctx, topic, groupID, timestamp, true); err != nil {
		return nil, err
	}
	return okResult(), nil
}

func (a *rocketMQAgent) getConsumerLag(params map[string]any) (any, error) {
	groupID, err := requireString(params, "groupId")
	if err != nil {
		return nil, err
	}
	topic, err := requireString(params, "topic")
	if err != nil {
		return nil, err
	}
	client, config, _ := a.requireClient()
	ctx, cancel := context.WithTimeout(context.Background(), config.RequestTimeout)

View on GitHub (pinned to c0390bff16)

Solutions

  1. Use exactly 'earliest', 'latest', or 'timestamp' for position
  2. For arbitrary points, set position to 'timestamp' and supply 'timestampMs'
  3. Normalize/trim and lowercase the position value in your tooling before dispatch

Example fix

// before
{"groupId": "g1", "topic": "t1", "position": "beginning"}
// after
{"groupId": "g1", "topic": "t1", "position": "timestamp", "timestampMs": 1720000000000}
Defensive patterns

Strategy: validation

Validate before calling

valid := map[string]bool{"earliest": true, "latest": true, "timestamp": true}
if !valid[position] {
    return fmt.Errorf("position must be earliest|latest|timestamp, got %q", position)
}
if position == "timestamp" && timestampMs <= 0 {
    return errors.New("timestampMs required when position=timestamp")
}

Prevention

When it happens

Trigger: Dispatching a reset-offsets action with a 'position' param such as 'beginning', 'oldest', 'END', or an empty string.

Common situations: Porting Kafka tooling vocabulary ('beginning'/'end') to RocketMQ; case-sensitivity mistakes ('Latest'); leaving position unset when a helper defaults it to something invalid.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/e13832772515bf48. Report an issue: GitHub.