fix(fleet): name the BACKEND in a placement refusal, not just "microvm capability"

Observed on the negative control: a mission with backend='kimi' was correctly
refused, but the message read "no online node reports microvm capability" — and
both nodes do report it. What one lacked was the image. That first clause would
have sent an operator to reinstall firecracker on a node that already had it.

The refusal now names the backend, and the remedy still names both halves.
This commit is contained in:
Omar Sobh
2026-08-05 17:31:23 -07:00
parent d9f53a3f96
commit 7696009b25
+13 -4
View File
@@ -152,10 +152,19 @@ pub async fn on_launch(
Some(want) => *capable
.iter()
.find(|n| n.as_uuid() == want)
.ok_or_else(|| format!("mission targets node {want}, which is not an online node reporting microvm capability ({how_to_fix})"))?,
None => *capable
.first()
.ok_or_else(|| format!("no online node reports microvm capability ({how_to_fix})"))?,
.ok_or_else(|| format!(
"mission targets node {want}, which is not an online node that can \
run backend {:?}{how_to_fix}",
backend.unwrap_or("default")
))?,
None => *capable.first().ok_or_else(|| format!(
// Names the BACKEND, not just "microvm capability". Both nodes
// report that capability; what one of them lacked was the image.
// The first version of this message would have sent an operator to
// reinstall firecracker on a node that already had it.
"no online node can run backend {:?} — {how_to_fix}",
backend.unwrap_or("default")
))?,
};
sqlx::query("UPDATE missions SET target_node_id = $1, updated_at = now() WHERE id = $2")
.bind(chosen.as_uuid())