fix: treat Frigate 500 'Could not process' as permanent rejection

Frigate returns HTTP 500 with 'Could not process' when its face detector
cannot find or embed a face in the uploaded crop — this will never succeed
on retry. Previously these were silently logged at DEBUG and retried on
every future run.

- Surface 500 error details inline (same display path as 400)
- Mark 500 + 'could not process' as a permanent rejection so the asset
  is skipped on future runs instead of retried indefinitely
This commit is contained in:
2026-06-17 17:16:04 +00:00
parent 5b8b3ab736
commit c4910d82ef
+2 -1
View File
@@ -566,13 +566,14 @@ def upload_to_frigate(jobs: list[dict]) -> None:
error_detail = resp.json().get("message", full_body[:100]) error_detail = resp.json().get("message", full_body[:100])
except Exception: except Exception:
error_detail = full_body[:100] error_detail = full_body[:100]
if resp.status_code == 400: if resp.status_code in (400, 500):
progress.console.print(f" [dim]{error_detail}[/dim]") progress.console.print(f" [dim]{error_detail}[/dim]")
else: else:
logger.debug("%s HTTP %s: %s", fname, resp.status_code, error_detail) logger.debug("%s HTTP %s: %s", fname, resp.status_code, error_detail)
_is_permanent = ( _is_permanent = (
(resp.status_code == 400 and "face" in full_body.lower()) (resp.status_code == 400 and "face" in full_body.lower())
or resp.status_code == 422 or resp.status_code == 422
or (resp.status_code == 500 and "could not process" in full_body.lower())
) )
if _is_permanent: if _is_permanent:
asset_id = asset_map.get(fname) asset_id = asset_map.get(fname)