Skip to content

fix(webhook): log reason for 400 responses#3

Merged
ttlequals0 merged 2 commits intomainfrom
fix/webhook-400-logging
Apr 12, 2026
Merged

fix(webhook): log reason for 400 responses#3
ttlequals0 merged 2 commits intomainfrom
fix/webhook-400-logging

Conversation

@ttlequals0
Copy link
Copy Markdown
Owner

@ttlequals0 ttlequals0 commented Apr 12, 2026

Summary

  • Plex deliveries to labelarr are being silently rejected with HTTP 400, and the handler logs nothing on any of the three 400 branches (multipart parse error, missing `payload` form field, JSON unmarshal error).
  • This adds targeted `[WEBHOOK] 400 ...` log lines that include the Content-Type, form/file part keys, and a payload snippet so we can identify which branch is firing on a real Plex POST.
  • Pure observability change — no behavior change, no new config.

Test plan

  • Docker build passes (`docker build -t labelarr:test .`)
  • Production image pushed: `ttlequals0/labelarr:v1.2.2` + `:latest`
  • Deploy via Portainer, wait for a real Plex `library.new` event, inspect Loki for `[WEBHOOK] 400` line and determine root cause

Plex deliveries were being rejected with bare HTTP 400s and no log
output, making it impossible to tell which failure path fired
(multipart parse, missing payload field, or JSON unmarshal). Each 400
branch now logs the error plus diagnostics (Content-Type, form/file
part keys, payload snippet) so the root cause of real Plex failures
can be diagnosed from logs alone.
Plex sends Metadata.Guid as an array of objects for items with multiple
provider IDs (imdb, tmdb, tvdb). PlexWebhookPayload declared it as a
string, so json.Unmarshal failed on every such payload and the handler
returned 400, making labelarr ignore all real webhooks. The field was
never read anywhere in the codebase; removing it lets the JSON decoder
skip it regardless of shape.
@ttlequals0 ttlequals0 force-pushed the fix/webhook-400-logging branch from dc4618b to d6ee9b4 Compare April 12, 2026 21:34
@ttlequals0 ttlequals0 merged commit 0809005 into main Apr 12, 2026
@ttlequals0 ttlequals0 deleted the fix/webhook-400-logging branch April 20, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant