censusreporter / census-api

The home for the API that powers the Census Reporter project.
MIT License
166 stars 50 forks source link

502 Bad Gateway errors on Shapefile requests #62

Closed JoeGermuska closed 4 years ago

JoeGermuska commented 7 years ago

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 )

JoeGermuska commented 5 years ago

Another report: https://api.censusreporter.org/1.0/data/download/latest?table_ids=B22005A&geo_ids=05000US06073,140|05000US06073,060|05000US06073,050|04000US06&format=shp

KML, GeoJson work.

iandees commented 4 years ago

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.