From 98601973f7ab61b10451f2ae08103c7f3ebdc425 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 30 Apr 2026 20:57:51 -0400 Subject: [PATCH] faces: log at the three 503 paths in update_face_handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PATCH /image/faces/{id} can return 503 from three places (face client disabled, transient embed error, mid-flight disable) and none of them were logging — operator sees the status code but nothing in the Rust log explaining why. Add warn! lines at each so future bbox-edit failures aren't silent. Response body is unchanged so existing clients keep working. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/faces.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/faces.rs b/src/faces.rs index 0c8ea16..35c8995 100644 --- a/src/faces.rs +++ b/src/faces.rs @@ -2311,6 +2311,12 @@ async fn update_face_handler( let mut new_embedding: Option> = None; if let Some((bx, by, bw, bh)) = bbox_patch { if !face_client.is_enabled() { + warn!( + "PATCH /image/faces/{}: 503 — face client not enabled \ + (APOLLO_FACE_API_BASE_URL / APOLLO_API_BASE_URL both unset). \ + Bbox edit requires Apollo to re-embed.", + id + ); return HttpResponse::ServiceUnavailable() .body("face client disabled — bbox edit requires Apollo"); } @@ -2387,9 +2393,19 @@ async fn update_face_handler( ); } Err(FaceDetectError::Transient(e)) => { + warn!( + "PATCH /image/faces/{}: 503 — Apollo face client transient \ + error during re-embed: {}", + id, e + ); return HttpResponse::ServiceUnavailable().body(format!("{}", e)); } Err(FaceDetectError::Disabled) => { + warn!( + "PATCH /image/faces/{}: 503 — face client became disabled \ + mid-flight", + id + ); return HttpResponse::ServiceUnavailable().body("face client disabled mid-flight"); } }