Forums

502-loadbalancer on blue-liveweb33

Hi I have my flask web app for a long time and it always worked fine. Today I've made few small, more visual changes and added few records to my sqlite database file. Nothing special. Hit the Reload button and:

Error code: 502-loadbalancer

Yesterday I also made very small change -> reload -> everything works great. Today there is this strange error. More strange is that:

  1. I don't see any error in any log
  2. In the log I can see my visits as normal with HTTP 200...
  3. In the log I noticed that most likely my app is running on the blue-liveweb33 node.

I know from other similar threads that usually it was correlated to long running code. But I don't think this is my case. This is simple webpage with no big traffic. It doesn't calculate anything special.

Note: I've checked this website on different browser and different machines. So, it's not correlated to the client for sure.

Any idea what's wrong?

The log from my entry:

[15/Aug/2024:21:35:12 +0000] "GET /station/Merida-Oriente HTTP/1.1" 200 5336 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0" "149.102.244.4" response-time=0.694

But in reality I'm getting Something went wrong :-(.... Error code: 502-loadbalancer

I also encountered the 502-backend error today. Still not able reload the website..

Are you perhaps putting a lot of data into a response header? I'm seeing an error on the loadbalancer "upstream sent too big header while reading response header from upstream" - where "upstream" is your web app

@rajamani I can see that your site is working now

Root cause found in my case:

Root cause: very large header size in the response

Why: I was storing a lot of data in the flask session. The flask session is stored in the cookies. The cookies are part of the response headers.

Fix: Stop storing vast amount of data in the flask session.

Now everything is back to normal.

@sboyd, it works fine now. Not sure of the root cause as I am not sending large size of header data in my case. Thanks for checking.

@yucatanbus & @rajamani -- thanks for letting us know!