A curious case of 520 errors with Nodejs and ALB

Sometimes you need to get your hands dirty and go down the rabbit hole. This was exactly what we had to do when we saw intermittent 502 errors on our API stack. 502 errors on AWS ALB The initial hypothesis was restarts at night, but the frequency of the errors was higher than the number of automated restarts. So to dig deeper we accessed the access logs of ALB (which are stored in gzip and add a…