Random 502 errors

Solved
PatWruk
Getting noticed

Random 502 errors

Is anyone else getting random 502 errors from the API? I have a script that monitors the uplinks of about 100 devices that runs every 5 minutes or so and the last few days I noticed that some of the data wasn't being retrieved, checking the logs it's receiving a 502 error back saying 'Bad Gateway'.

it doesn't happen on every request but it does happen a few times throughout the day

1 Accepted Solution
sungod
Kind of a big deal

Availability is not 100%.

 

There can be various errors, if you are doing automated data gathering you need to code to handle the errors.

 

I now use a mix... initially API failures are re-tried several times, with increasing delay from a couple of seconds to a couple of minutes, that will cope with most issues. Sometimes that is not enough, if the initial method fails, the capture is aborted and re-run an hour or so later, which is generally enough time.

 

View solution in original post

3 Replies 3
Inderdeep
Kind of a big deal
Kind of a big deal

@PatWruk Check not sure if it helps 

502 Bad Gateway Error: What It Is and How to Fix It (lifewire.com)

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
sungod
Kind of a big deal

Availability is not 100%.

 

There can be various errors, if you are doing automated data gathering you need to code to handle the errors.

 

I now use a mix... initially API failures are re-tried several times, with increasing delay from a couple of seconds to a couple of minutes, that will cope with most issues. Sometimes that is not enough, if the initial method fails, the capture is aborted and re-run an hour or so later, which is generally enough time.

 

PatWruk
Getting noticed

@sungod, Yeah I'm able to handle the error, just not something I had seen before and was wondering if others had the same issue.

Get notified when there are additional replies to this discussion.