censusreporter/census-api

502 Bad Gateway errors on Shapefile requests

JoeGermuska opened this issue · 2 comments

This may not be limited to shapefiles, but we had a Uservoice report of errors trying to get all congressional districts in the US (https://api.censusreporter.org/1.0/data/download/latest?table_ids=B05006&geo_ids=500|01000US&format=shp)

On the hypothesis that it was related to the size of the download, I tried a few other groupings (districts in a specific region, division, state) and for each, at least occasionally got the error -- even with all districts in Alaska, which should not be a large file)

Of course it may not be limited to Shapefiles, but that's all I tested.

(this report also flushed out censusreporter/censusreporter#213 )

502's happen when it takes too long for the backend to respond. This happens because you're requesting too much data. I'd recommend requesting smaller slices of data and combining them together.