avwx-rest/avwx-api

502 Errors from the API.

Closed this issue · 3 comments

We are getting some fairly frequent (multiple times a day) 502's coming back from the API. They appear like this:

{
    "meta": {
        "timestamp": "2019-08-08T16:06:27.607719Z"
    },
    "error": "Report Lookup Error: Unable to reach data source after 5 attempts"
}

The lookup is against OMAA station (Abu Dhabi Intl). We are using a free account on avwx for these queries.

Yes. Thank you. I switched the caching layer to a different system that wasn't ready for the METAR report load. I'm in the process is switching it back for that one report type for the time being. This should reduce the error you're seeing.

On further investigation, it's not the caching layer. The call to fetch reports from NOAA is timing out. Currently, I am unsure how to mitigate this issue other than reducing the very lengthy timeout to return the error sooner and free up the worker thread. I'm trying a variety of approaches that don't appear to work.

The NOAA server seems to be back to normal and response times are back to ~10ms. I've improved the error reporting, lessened request timeouts, and made the wording of that particular error more helpful for when this happens again. Going to mark as closed.