kaf212 / uebungsverwaltung

Das eScout ermöglicht schnelles und effizientes Verwalten von Pfadi-Aktivitäten im Browser. Die Applikation befindet sich im Alpha-Stadium.
0 stars 0 forks source link

API randomly returning HTTP 502 #8

Closed kaf212 closed 3 weeks ago

kaf212 commented 1 month ago

The API-server sometimes serves data to the frontend as it should and sometimes returns a 502. About 10-25% of all requests fail.

When accessing the API directly over it's own external IP it works fine and reliably.

The logs of the NGINX container show that some of the proxy-redirects to the backend work fine like here:

172.16.0.11 - - [18/Aug/2024:16:00:14 +0000] "GET /api/uebungen HTTP/1.1" 200 3237 "http://51.159.9.164/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"

and some don't:

2024/08/18 16:00:14 [error] 29#29: *93 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.0.11, server: , request: "GET /api/uebungen HTTP/1.1", upstream: "http://10.36.29.104:80/api/uebungen", host: "51.159.9.164", referrer: "http://51.159.9.164/"

To try and resolve the issue, the following was tried:

kaf212 commented 3 weeks ago

The bug itself was fixed in 0176f6b1ff2a70856d7ffacc78c7d93b8743fe46 by increasing the proxy_pass timeout interval in the Nginx config. The issue persists because the frontend container struggles with fetching frontend resources like the JS-files and images which of course can interfere with API connections as well. A new issue will be opened.