t8y2/dbx · error
topic (queue name) is required
Error message
topic (queue name) is required
What it means
queueName resolves the target queue from the 'topic' parameter, falling back to 'name'. If both are empty or whitespace, the driver cannot identify which queue to operate on and throws this error. It guards all queue-scoped operations (create/delete/stats/config/purge).
Source
Thrown at agents/drivers/rabbitmq/helpers.go:340
return nil, errors.New("Not connected. Call connect first.")
}
return connection, nil
}
func (s *server) requireConnection() (*amqp.Connection, error) {
if s.connection == nil {
return nil, errors.New("Not connected. Call connect first.")
}
return s.connection, nil
}
func queueName(params jsonObject) (string, error) {
name := stringOrEmpty(params, "topic")
if strings.TrimSpace(name) == "" {
name = stringOrEmpty(params, "name")
}
if strings.TrimSpace(name) == "" {
return "", errors.New("topic (queue name) is required")
}
return name, nil
}
func effectiveVhost(params, connection jsonObject) string {
vhost := stringOrNull(params, "virtual_host")
if vhost == nil || strings.TrimSpace(*vhost) == "" {
if connection != nil {
return stringOrDefault(connection, "virtual_host", "/")
}
return "/"
}
return *vhost
}
func allVhostsRequested(params jsonObject) bool {
return boolOrDefault(params, "all_vhosts", false)
}View on GitHub (pinned to c0390bff16)
Solutions
- Add a non-empty 'topic' parameter to the call
- Or supply 'name' with the queue name as a fallback
- Check that the config/env var feeding the topic value is actually set and not whitespace
Example fix
// before
result := agent.Call("mq_purge_queue", map[string]any{"topic": ""})
// after
result := agent.Call("mq_purge_queue", map[string]any{"topic": "orders-queue"}) Defensive patterns
Strategy: validation
Validate before calling
topic := strings.TrimSpace(params["topic"])
if topic == "" { topic = strings.TrimSpace(params["name"]) }
if topic == "" { return errors.New("call requires a non-empty 'topic' (or 'name')") } Type guard
func hasTopic(params map[string]any) bool {
s, _ := params["topic"].(string)
if strings.TrimSpace(s) == "" { s, _ = params["name"].(string) }
return strings.TrimSpace(s) != ""
} Try / catch
result, err := agent.Call("mq_purge_queue", params)
if err != nil && strings.Contains(err.Error(), "topic (queue name) is required") {
return fmt.Errorf("config error: queue/topic name missing in %v", params)
} Prevention
- Always set 'topic' explicitly in queue-scoped calls
- Centralize queue name resolution in one config helper
- Fail fast at startup if the configured queue name is blank
When it happens
Trigger: Calling mq_create_topic, mq_delete_topic, mq_get_topic_stats, mq_get_topic_config, or mq_purge_queue with params lacking both 'topic' and 'name', or with a value that is empty or only whitespace (e.g. topic: "").
Common situations: Config files where the topic key is misspelled ('queue' instead of 'topic'); templated configs where an env var like TOPIC_NAME is unset; building params programmatically and leaving the field blank.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/ccc75127f1719663.
Report an issue: GitHub.