Page MenuHomePhabricator

Improve EventGate's error message when the client's HTTP Content-Type is not the one expected
Closed, ResolvedPublic

Description

While testing T301878, it took a while to end up with the following fix: https://gerrit.wikimedia.org/r/c/machinelearning/liftwing/inference-services/+/814098

Tornado (part of KServe/LiftWing) uses application/x-www-form-urlencoded as Content-Type for its HTTP client (for POSTs), unless explicitly told otherwise (like using Content-type: application/json). In EventGate's logs we found only these traces:

event e1809d3f-db47-493d-bd36-9c0575e63649 of schema at /mediawiki/revision/score/2.0.0 destined to stream unknown encountered an error: Field(s) meta.stream were missing from event and could not be extracted.","time":"2022-07-14T07:25:39.758Z","v":0}

The above error message led us to think that the stream field was not populated for some reason, and the strange thing was that the schema was picked up correctly. After some tests we figure out it was the wrong Content-type, so we thought to open a task to see if the error message could be improved or not :)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Nice! Left a Q but LGTM! If my Q makes sense. Let's merge and deploy it.

@tchin Just published eventgate 1.8.3 on npm. Next step is to update eventgate-wikimedia package.json with that version as dependency.

Change 833388 had a related patch set uploaded (by TChin; author: TChin):

[eventgate-wikimedia@master] Bump to eventgate 1.8.3 to remove unsupported Content-Type application/x-www-form-urlencoded

https://gerrit.wikimedia.org/r/833388

Change 833388 merged by Ottomata:

[eventgate-wikimedia@master] Bump to eventgate 1.8.3 to remove unsupported Content-Type application/x-www-form-urlencoded

https://gerrit.wikimedia.org/r/833388

Change 833428 had a related patch set uploaded (by TChin; author: TChin):

[operations/deployment-charts@master] Bump eventgate-* image versions

https://gerrit.wikimedia.org/r/833428

Change 833428 merged by Ottomata:

[operations/deployment-charts@master] Bump eventgate-* image versions

https://gerrit.wikimedia.org/r/833428