t8y2/dbx · critical
addresses is required
Error message
addresses is required
What it means
openConnection iterates over resolved address candidates; if no candidate was resolved at all (lastError == nil), it means the connection config contained no usable addresses, so the driver throws this error instead of a dial error.
Source
Thrown at agents/drivers/rabbitmq/main.go:352
_ = connection.Close()
}
}
func openConnection(config jsonObject) (*amqp.Connection, error) {
addresses, err := resolveAddresses(config)
if err != nil {
return nil, err
}
var lastError error
for _, endpoint := range addresses {
connection, dialError := dialAddress(config, endpoint)
if dialError == nil {
return connection, nil
}
lastError = dialError
}
if lastError == nil {
return nil, errors.New("addresses is required")
}
return nil, lastError
}
func dialAddress(config jsonObject, endpoint address) (*amqp.Connection, error) {
properties := objectOrNil(config, "properties")
connectOverride, err := endpointOverride(config, "connect_override")
if err != nil {
return nil, err
}
connectionTimeout := durationMilliseconds(config, "request_timeout_ms", defaultRequestTimeout)
if configured, ok := integerProperty(properties, "connection_timeout_ms"); ok {
connectionTimeout = time.Duration(configured) * time.Millisecond
}
handshakeTimeout := defaultHandshakeTimeout
if configured, ok := integerProperty(properties, "handshake_timeout_ms"); ok {
handshakeTimeout = time.Duration(configured) * time.Millisecond
}View on GitHub (pinned to c0390bff16)
Solutions
- Set a non-empty 'addresses' value in the connection config
- Or set 'host' (with optional 'port') as a fallback
- Validate the config (addresses/host present) before calling connect
Example fix
// before
config := map[string]any{"vhost": "prod"}
conn, err := agent.Connect(config)
// after
config := map[string]any{"addresses": "rabbit1:5672,rabbit2:5672", "vhost": "prod"}
conn, err := agent.Connect(config) Defensive patterns
Strategy: validation
Validate before calling
addrs := strings.TrimSpace(cfg["addresses"])
if addrs == "" { addrs = strings.TrimSpace(cfg["host"]) }
if addrs == "" { return errors.New("connection config needs 'addresses' or 'host'") } Type guard
func hasEndpoint(cfg map[string]any) bool {
for _, k := range []string{"addresses", "host"} {
if s, ok := cfg[k].(string); ok && strings.TrimSpace(s) != "" { return true }
}
return false
} Try / catch
conn, err := agent.Connect(cfg)
if err != nil && strings.Contains(err.Error(), "addresses is required") {
return fmt.Errorf("rabbitmq config incomplete: set addresses or host (env: RABBITMQ_ADDRESSES)")
} Prevention
- Validate connection config at process startup
- Source addresses from env with a sane default (e.g. localhost:5672)
- Log the resolved config (minus secrets) when connecting
When it happens
Trigger: Calling connect/testConnection (or anything that dials: channelFor, primaryChannel, peekMessages) with a config where no addresses could be resolved — reaching openConnection with an empty candidate list.
Common situations: Empty or whitespace-only 'addresses'/'host' config value that slipped past earlier checks; config built dynamically where the host key is present but blank; environment-specific config missing the broker host.
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
- Not connected. Call connect first.
- Not connected. Call connect first.
- Connection failed
- H2 JDBC driver rejected URL: " + buildJdbcUrl(params)
- Informix connection failed.\nURL: " + url.replaceAll("//[^@]
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/54010066928813fc.
Report an issue: GitHub.