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
- Use exactly 'earliest', 'latest', or 'timestamp' for position
- For arbitrary points, set position to 'timestamp' and supply 'timestampMs'
- 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
- Use only the documented literals: earliest, latest, timestamp
- Map Kafka terms in wrappers (beginning->earliest, end->latest)
- Lowercase/trim user input before dispatch
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
- consumer group not found: %s
- Agent runtime thread limits must be positive
- Databend procedure names with special characters are not sup
- Unsupported object type: null
- Unsupported H2 driver profile: " + profile
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/e13832772515bf48.
Report an issue: GitHub.