From 6c315edacc0379c1ebbc1a761263496e3e207ac2 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Sun, 14 Jun 2026 02:02:57 -0400 Subject: [PATCH] clip_client: log encode_text failures (URL + status/body or network error) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CLIP encode failure reason was only ever returned in the HTTP response body, never logged server-side, making 502s from /photos/search opaque. Log the underlying cause — network error to the URL, or the Apollo HTTP status + response body — so CLIP-service problems are diagnosable from the ImageApi log. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ai/clip_client.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ai/clip_client.rs b/src/ai/clip_client.rs index 85c66a7..3519e8b 100644 --- a/src/ai/clip_client.rs +++ b/src/ai/clip_client.rs @@ -191,11 +191,13 @@ impl ClipClient { let resp = match self.client.post(&url).json(&body).send().await { Ok(r) => r, Err(e) if e.is_timeout() || e.is_connect() => { + log::warn!("clip encode_text network error to {url}: {e}"); return Err(ClipError::Transient(anyhow::anyhow!( "clip client network: {e}" ))); } Err(e) => { + log::warn!("clip encode_text request error to {url}: {e}"); return Err(ClipError::Transient(anyhow::anyhow!( "clip client request: {e}" ))); @@ -210,6 +212,7 @@ impl ClipClient { return Ok(body); } let body_text = resp.text().await.unwrap_or_default(); + log::warn!("clip encode_text HTTP {status} from {url}: {body_text}"); Err(classify_error_response(status.as_u16(), &body_text)) }