{"record":{"id":"83ea0e901edb5855","repo":"t8y2/dbx","slug":"rabbitmq-management-api-url-is-required-when-amqp","errorCode":null,"errorMessage":"RabbitMQ Management API URL is required when AMQP uses non-default port %d because the Management listener port is configured independently","messagePattern":"RabbitMQ Management API URL is required when AMQP uses non-default port (.+?) because the Management listener port is configured independently","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rabbitmq/management.go","lineNumber":189,"sourceCode":"\t\t}\n\t}\n}\n\nfunc managementBaseURLs(connection jsonObject) ([]string, error) {\n\tif explicit := stringOrNull(connection, \"management_url\"); explicit != nil && strings.TrimSpace(*explicit) != \"\" {\n\t\treturn []string{normalizeManagementURL(*explicit)}, nil\n\t}\n\ttlsEnabled := managementTLS(connection)\n\taddresses, err := resolveAddresses(connection)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tport, configured := configuredManagementPort(connection, tlsEnabled)\n\tif !configured {\n\t\tfor _, endpoint := range addresses {\n\t\t\tisDefaultAMQPPort := endpoint.Port == defaultAMQPPort || (tlsEnabled && endpoint.Port == defaultAMQPTLSPort)\n\t\t\tif !isDefaultAMQPPort {\n\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\"RabbitMQ Management API URL is required when AMQP uses non-default port %d because the Management listener port is configured independently\",\n\t\t\t\t\tendpoint.Port,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\tbaseURLs := make([]string, 0, len(addresses))\n\tfor _, endpoint := range addresses {\n\t\tbaseURLs = append(baseURLs, managementBaseURL(endpoint.Host, port, tlsEnabled))\n\t}\n\treturn baseURLs, nil\n}\n\nfunc managementBaseURL(host string, port int, tlsEnabled bool) string {\n\tscheme := \"http\"\n\tif tlsEnabled {\n\t\tscheme = \"https\"\n\t}","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rabbitmq/management.go#L171-L207","documentation":"RabbitMQ's Management API listens on its own port (default 15672/15671) configured independently of the AMQP listener. When no explicit management_url is given, the driver can only infer the management port if AMQP uses a default port (5672/5671). If AMQP runs on a custom port and management is not configured, inference is impossible and this error is thrown.","triggerScenarios":"Configuring an AMQP endpoint with a non-default port (e.g. 5673) while omitting management_url (or the management port setting) in the connection object, then issuing any operation that needs managementRequest.","commonSituations":"Docker deployments remapping 5672 to a host port, brokers installed with a custom amqp listener in rabbitmq.conf, Kubernetes NodePort/LoadBalancer services exposing a non-standard AMQP port.","solutions":["Set management_url in the connection config to the broker's management endpoint (e.g. http://host:15672)","Or configure the management port explicitly so configuredManagementPort reports it as configured","Or use the default AMQP port (5672, TLS 5671) so the driver can infer the management port","Verify the management plugin is listening on the URL you provide (rabbitmqctl status / curl)"],"exampleFix":"// before\nconnection = {\"host\": \"broker\", \"port\": 5673, \"username\": \"app\", \"password\": \"pw\"}\n// after\nconnection = {\"host\": \"broker\", \"port\": 5673, \"username\": \"app\", \"password\": \"pw\", \"management_url\": \"http://broker:15672\"}","handlingStrategy":"validation","validationCode":"func validateRabbitMQConfig(conn map[string]any) error {\n    port, _ := conn[\"port\"].(float64)\n    mgmt, hasMgmt := conn[\"management_url\"].(string)\n    if port != 5672 && port != 5671 && (!hasMgmt || strings.TrimSpace(mgmt) == \"\") {\n        return fmt.Errorf(\"custom AMQP port %v requires management_url\", port)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set management_url explicitly when using non-default AMQP ports","Add config validation at application startup","Document the management port next to the AMQP port in deployment configs","Health-check both AMQP and management endpoints in readiness probes"],"tags":["rabbitmq","configuration","port","management-api"],"backgroundTag":"missing-config-credential","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}