Hankintailmoitukset / hilma-api

11 stars 0 forks source link

Upstream error - what happened and what to do? #179

Closed eduardsmirnov closed 1 year ago

eduardsmirnov commented 1 year ago

Attempt to submit a notice with etsIdentified "4933dca2-3190-43a1-bd4f-87ac3dcff4b4-01" returns {"type":"Hilma API Error","title":"Upstream error","status":502,"detail":"Upstream failure","traceId":"a8fc3ac8eb301c647d68917df844f0ce"}

{ "type": "Hilma API Error", "title": "Upstream error", "status": 502, "detail": "Upstream failure", "traceId": "52dad3964b02119c969c2ea29d1cedd3" }

What is wrong?

arinurkkala commented 1 year ago

TED is currently down. https://cvs.preview.ted.europa.eu/swagger-ui/index.html

eduardsmirnov commented 1 year ago

Does it mean Hilma will not accept notices when TED is down? What should be correct behavior for API callers in this way? Is it possible to make a difference when the deny of service is expected (we should wait and re-call API) or a real error (we should stop processing)?

arinurkkala commented 1 year ago

Yes. Hilma executes validation against TED api before handling the notice. If it fails, it will return an error. If the error is a validation error, problemDetails will be populated. Else it will be left empty. Also the HTTP verb is 400 for validation errors. TED currently returns the 502 and that is also given back by Hilma.

Havunen commented 1 year ago

The upstream error responses have been changed to more informative and the message now mentions TED when that is the case. Please re-open if this is still an issue