{"record":{"id":"84c45560f6500fdb","repo":"zeroclaw-labs/zeroclaw","slug":"amqp-url-must-start-with-amqp-or-amqps","errorCode":null,"errorMessage":"amqp_url must start with 'amqp://' or 'amqps://', got: {}","messagePattern":"amqp_url must start with 'amqp://' or 'amqps://', got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":16607,"sourceCode":"    #[serde(default)]\n    pub excluded_tools: Vec<String>,\n}\n\nimpl AmqpConfig {\n    /// Validate the AMQP configuration.\n    ///\n    /// Checks:\n    /// - `amqp_url` uses a valid scheme (`amqp://` or `amqps://`)\n    /// - `amqps://` connections carry a CA certificate\n    /// - `client_cert` and `client_key` are supplied together (mutual TLS)\n    /// - the exchange is non-empty\n    /// - at least one routing key is bound\n    pub fn validate(&self) -> anyhow::Result<()> {\n        let is_tls = self.amqp_url.starts_with(\"amqps://\");\n        let is_plain = self.amqp_url.starts_with(\"amqp://\");\n\n        if !is_tls && !is_plain {\n            anyhow::bail!(\n                \"amqp_url must start with 'amqp://' or 'amqps://', got: {}\",\n                self.amqp_url\n            );\n        }\n\n        if is_tls && self.ca_cert.is_none() {\n            anyhow::bail!(\"amqps:// requires ca_cert to verify the broker\");\n        }\n\n        match (self.client_cert.is_some(), self.client_key.is_some()) {\n            (true, false) => {\n                anyhow::bail!(\n                    \"client_cert is set but client_key is missing (both are required for mutual TLS)\"\n                )\n            }\n            (false, true) => {\n                anyhow::bail!(\n                    \"client_key is set but client_cert is missing (both are required for mutual TLS)\"","sourceCodeStart":16589,"sourceCodeEnd":16625,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L16589-L16625","documentation":"`AmqpConfig` (the generic AMQP 0-9-1 consumer used for RabbitMQ, Fedora Messaging, etc.) accepts only `amqp://` or `amqps://` as the `amqp_url` scheme, checked as a literal prefix. AMQP 0-9-1 has no other transport scheme, so anything else — including RabbitMQ-specific pseudo-schemes — is rejected before connection.","triggerScenarios":"`amqp_url = \"rabbitmq://localhost:5672/%2F\"` (Spring-style pseudo-scheme); a bare `localhost:5672`; pasting an `http://` management-UI URL instead of the AMQP port; typos like `amqp:/`.","commonSituations":"Copying connection strings from Spring Boot or Heroku docs that use `rabbitmq://`; grabbing the URL from the RabbitMQ management interface (15672, HTTP) rather than the AMQP listener (5672/5671); missing vhost encoding is fine but a missing scheme is not.","solutions":["Use `amqp://host:5672/<vhost>` for plain connections (URL-encode the default vhost `/` as `%2F`).","Use `amqps://host:5671/<vhost>` for TLS and supply `ca_cert` (and client pair for mTLS).","Verify you are pointing at the AMQP port, not the management port."],"exampleFix":"# before\namqp_url = \"rabbitmq://localhost:5672/%2F\"\n\n# after\namqp_url = \"amqp://localhost:5672/%2F\"","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    cfg.amqp_url.starts_with(\"amqp://\") || cfg.amqp_url.starts_with(\"amqps://\"),\n    \"bad amqp_url scheme: {}\",\n    cfg.amqp_url\n);","typeGuard":"fn is_amqp_url(url: &str) -> bool {\n    url.starts_with(\"amqp://\") || url.starts_with(\"amqps://\")\n}","tryCatchPattern":null,"preventionTips":["Rewrite rabbitmq:// pseudo-schemes to amqp:// when porting from Spring docs.","Target the AMQP port (5672/5671), not the HTTP management port (15672).","URL-encode the default vhost as %2F."],"tags":["amqp","rabbitmq","config","url","scheme","zeroclaw"],"backgroundTag":"invalid-url-scheme","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}