zazuko / trifid

Lightweight Linked Data Server and Proxy
Apache License 2.0
81 stars 11 forks source link

Improve signalling of gateway errors #39

Closed mchlrch closed 2 years ago

mchlrch commented 6 years ago

In order to facilitate debugging of configuration and infrastructure issues, the current handling of errors and status codes != HTTP 2xx received from the Triplestores SPARQL-Endpoint could be improved.

(sparqlProxy only) HTTP 502 expected instead of HTTP 200:

(hydraBox only) HTTP 502 expected instead of HTTP 204:

(sparqlProxy, hydraBox) HTTP 504 expected instead of empty reply:

(sparqlProxy, hydraBox) HTTP 502 instead of HTTP 500 would be more specific:

mchlrch commented 6 years ago

To simulate HTTP replies and errors of the SPARQL-Endpoint, I used the following code: https://github.com/mchlrch/playground_nodejs/tree/master/http_simstub

tpluscode commented 5 years ago

To sum up my thoughts on the discussion yesterday:

I agree that the gateway status codes seem appropriate for sparqlProxy. Trifid is indeed acting as a gateway or proxy. It's even in the name.

For hydra-box I'm less convinced. Even if it call external services, it's more than a proxy. The fact that it can be used standalone suggests that hydra box should be solely responsible for its status codes.

And circling back, maybe so should be sparqlProxy? I admit I don't understand the relation between Trifid and the other elements...

bergos commented 2 years ago

This issue describes how the problem can be reproduced: https://github.com/zazuko/sparql-proxy/issues/10