{"record":{"id":"2a68e6998fe29f19","repo":"reacherhq/check-if-email-exists","slug":"worker-configuration-is-missing-the-rabbitmq-confi","errorCode":null,"errorMessage":"Worker configuration is missing the rabbitmq configuration","messagePattern":"Worker configuration is missing the rabbitmq configuration","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"backend/src/config.rs","lineNumber":207,"sourceCode":"\t/// Attempt connection to the Postgres database and RabbitMQ. Also populates\n\t/// the internal `pg_pool` and `channel` fields with the connections.\n\tpub async fn connect(&mut self) -> Result<(), anyhow::Error> {\n\t\tmatch &self.storage {\n\t\t\tSome(StorageConfig::Postgres(config)) => {\n\t\t\t\tlet storage = PostgresStorage::new(&config.db_url, config.extra.clone())\n\t\t\t\t\t.await\n\t\t\t\t\t.with_context(|| format!(\"Connecting to postgres DB {}\", config.db_url))?;\n\n\t\t\t\tself.storage_adapter = Arc::new(StorageAdapter::Postgres(storage));\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tself.storage_adapter = Arc::new(StorageAdapter::Noop);\n\t\t\t}\n\t\t}\n\n\t\tlet channel = if self.worker.enable {\n\t\t\tlet rabbitmq_config = self.worker.rabbitmq.as_ref().ok_or_else(|| {\n\t\t\t\tanyhow::anyhow!(\"Worker configuration is missing the rabbitmq configuration\")\n\t\t\t})?;\n\t\t\tlet channel = setup_rabbit_mq(&self.backend_name, rabbitmq_config).await?;\n\t\t\tSome(Arc::new(channel))\n\t\t} else {\n\t\t\tNone\n\t\t};\n\t\tself.channel = channel;\n\n\t\t// Initialize throttle manager\n\t\tself.throttle_manager = Arc::new(ThrottleManager::new(self.throttle.clone()));\n\n\t\tOk(())\n\t}\n\n\t/// Get the Postgres connection pool, if the storage is Postgres.\n\tpub fn get_storage_adapter(&self) -> Arc<StorageAdapter> {\n\t\tself.storage_adapter.clone()\n\t}","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/reacherhq/check-if-email-exists/blob/81da93e8a419f601c05e1bcf4a197d25eb0e349d/backend/src/config.rs#L189-L225","documentation":"The backend can be run in worker mode (worker.enable = true), in which case it must connect to RabbitMQ. This error is raised during connect() when worker mode is enabled but the worker.rabbitmq configuration section is entirely absent from the config file, so setup_rabbit_mq cannot be called.","triggerScenarios":"Config file contains [worker] with enable = true but no [worker.rabbitmq] section; connect() reads self.worker.rabbitmq, gets None via as_ref().ok_or_else(...), and returns the error before calling setup_rabbit_mq.","commonSituations":"Users enabling workers after copying a minimal config that only has [worker]; switching from HTTP-only deployment to queue-based deployment without adding RabbitMQ settings; typos in the TOML key (e.g. [worker.rabbit_mq]) that deserialize to nothing.","solutions":["Add the [worker.rabbitmq] section with connection settings (host, port, credentials) to the config file.","Alternatively set worker.enable = false if RabbitMQ connectivity is not needed.","Verify the key is exactly rabbitmq (no typo) in the TOML/YAML config.","Check which config file the process actually loads (path/env override) and edit that one."],"exampleFix":"// before (config)\n[worker]\nenable = true\n// after\n[worker]\nenable = true\n\n[worker.rabbitmq]\nuri = \"amqp://guest:guest@localhost:5672/%2f\"","handlingStrategy":"validation","validationCode":"if config.worker.enable && config.worker.rabbitmq.is_none() {\n    return Err(anyhow!(\"worker.enable=true requires [worker.rabbitmq] in the config\"));\n}","typeGuard":"fn rabbitmq_ready(enable: bool, rabbitmq: &Option<RabbitMqConfig>) -> bool {\n    !enable || rabbitmq.is_some()\n}","tryCatchPattern":null,"preventionTips":["Keep a canonical config template that includes [worker.rabbitmq] whenever workers are enabled.","Validate the full config at startup/deploy time (CI check) before rollout.","Watch for TOML key typos like rabbit_mq that silently deserialize to None."],"tags":["config","rabbitmq","startup"],"backgroundTag":"missing-required-config-field","analyzedSha":"81da93e8a419f601c05e1bcf4a197d25eb0e349d","analyzedAt":"2026-09-11T10:06:14.663Z","contentChangedAt":"2026-09-11T10:06:14.663Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}