reacherhq/check-if-email-exists · error · anyhow::Error

Missing reply_to or correlation_id

Error message

Missing reply_to or correlation_id

What it means

send_single_shot_reply builds a one-off reply to the backend over RabbitMQ. It requires either a reply_to routing address or a correlation_id to know where the response belongs; when both are absent from the incoming task metadata, it bails with this error instead of publishing an unrouteable reply. It indicates the caller/task payload is missing reply addressing fields.

Solutions

  1. Set reply_to (and ideally correlation_id) on the task message when publishing it to the worker queue.
  2. Upgrade/reconfigure the producer so it propagates message properties instead of only the JSON body.
  3. If a task legitimately has no reply target, use a code path that skips the reply rather than send_single_shot_reply.
  4. Check whether the message passed through a dead-letter or forwarding exchange that dropped properties and re-send it.

Example fix

// before: publishing a task without reply properties
channel.basic_publish(exchange, queue, body=task_json)
// after
channel.basic_publish(exchange, queue, body=task_json,
    properties=BasicProperties(reply_to="amq.rabbitmq.reply-to", correlation_id=job_id))
Defensive patterns

Strategy: validation

Validate before calling

if task.reply_to.is_none() && task.correlation_id.is_none() {
    return Err(anyhow!("task must carry reply_to or correlation_id before dispatch"));
}

Type guard

fn has_reply_addressing(reply_to: &Option<Uuid>, correlation_id: &Option<Uuid>) -> bool {
    reply_to.is_some() || correlation_id.is_some()
}

Prevention

When it happens

Trigger: consume_check_email or do_check_email_work dispatch a single-shot email verification task whose message properties lack both reply_to and correlation_id, so send_single_shot_reply reaches the else branch and executes bail!("Missing reply_to or correlation_id").

Common situations: Publishing tasks to the RabbitMQ queue directly without setting reply_to/correlation_id properties; older producers built before reply addressing was added; replaying messages from a dead-letter queue after properties were stripped; misconfigured producer frameworks that drop message headers.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of reacherhq/check-if-email-exists@81da93e8a4 (2026-09-11). Data as JSON: /api/errors/dcd404492f090381. Report an issue: GitHub.

Appendix: source

Thrown at backend/src/worker/single_shot.rs:96

			.with_content_type("application/json".into());

		let single_shot_response = SingleShotReply::try_from(worker_output)?;
		let reply_payload = serde_json::to_vec(&single_shot_response)?;

		channel
			.basic_publish(
				"",
				reply_to.as_str(),
				BasicPublishOptions::default(),
				&reply_payload,
				properties,
			)
			.await?
			.await?;

		debug!(target: LOG_TARGET, reply_to=?reply_to.to_string(), correlation_id=?correlation_id.to_string(), "Sent reply")
	} else {
		bail!("Missing reply_to or correlation_id");
	}

	Ok(())
}

View on GitHub (pinned to 81da93e8a4)