From bbe1b19819630e8a1ddda9a7d1059c16882c4b11 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2026 20:14:16 -0400 Subject: [PATCH] store: fix FindActiveByMAC scanning profile column that wasn't selected Sibling Run-scan sites (Get, LatestForHost, ListForHost, Active) were updated to include COALESCE(profile,'quick') in the SELECT when the Phase 1 migration added the column; FindActiveByMAC was missed, so Scan got 14 destination args for a 13-column row. The symptom is /ipxe/{mac} returning 500 and the host booting nothing, since that handler is what returns the live-image script. Co-Authored-By: Claude Opus 4.7 --- internal/store/runs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/store/runs.go b/internal/store/runs.go index 1d142e7..9f40b0d 100644 --- a/internal/store/runs.go +++ b/internal/store/runs.go @@ -283,7 +283,8 @@ func (r *Runs) FindActiveByMAC(ctx context.Context, mac string) (*model.Run, err SELECT r.id, r.host_id, r.state, COALESCE(r.result,''), COALESCE(r.failed_stage,''), COALESCE(r.next_boot_target,''), r.agent_token_hash, r.started_at, r.completed_at, COALESCE(r.report_path,''), COALESCE(r.hold_ip,''), - COALESCE(r.override_flags_json,''), COALESCE(r.non_destructive,0) + COALESCE(r.override_flags_json,''), COALESCE(r.non_destructive,0), + COALESCE(r.profile,'quick') FROM runs r JOIN hosts h ON h.id = r.host_id WHERE h.mac = ? AND r.state NOT IN ('Completed','Released','Cancelled')