Status Code 500 error with Legislator Geo Lookup API as of 25 Aug 2018


Hello everybody. I’ve been using openStates to get information on State House Representatives for about a year in an iOS voter-engagement app I’m developing. I’m suddenly getting a server error and I need some feedback on what this might be. Note that the address and fields being called are being used by a few beta testers now with no issues…until today.

Below I’ll post the URLResponse as well as the crash report returned from the API call. Is this happening to anybody else? Help!!

The URLResponse package has
<NSHTTPURLResponse: 0x17803ec00> { URL:,party,chamber,district,active,url,photo_url,office_phone,offices,state,level,email,offices,full_name,first_name,middle_name,last_name,suffixes,id }

{ status code: 500, headers {
“Access-Control-Allow-Origin” = “*”;
“Content-Type” = “application/json; charset=utf-8”;
Date = “Sat, 25 Aug 2018 11:18:45 GMT”;
Server = “nginx/1.10.3 (Ubuntu)”;
“Strict-Transport-Security” = “max-age=31536000”;
Vary = Authorization;
} }

The data returned could be serialized to the following crash report
2018-08-25 18:18:46.063326+0700 ElectLiberalUSA[5217:2828166] Data is: Piston/0.2.3rc1 (Django 1.9.13) crash report:

Traceback (most recent call last):

File “/home/openstates/virt/local/lib/python2.7/site-packages/newrelic/hooks/”, line 33, in call
return self._nr_wrapped(*args, **kwargs)

File “/home/openstates/virte51090ea9e0b4384ccb574fcaac07778b0f75996/src/billy/billy/web/api/”, line 88, in new_read
obj = old_read(*args, **kwargs)

File “/home/openstates/virte51090ea9e0b4384ccb574fcaac07778b0f75996/src/billy/billy/web/api/”, line 396, in read
resp = json.load(urllib2.urlopen(url, timeout=0.5))

File “/usr/lib/python2.7/”, line 154, in urlopen
return, data, timeout)

File “/home/openstates/virt/local/lib/python2.7/site-packages/newrelic/hooks/”, line 31, in nr_wrapper_opener_director_open
return wrapped(*args, **kwargs)

File “/usr/lib/python2.7/”, line 429, in open
response = self._open(req, data)

File “/usr/lib/python2.7/”, line 447, in _open
‘_open’, req)

File “/usr/lib/python2.7/”, line 407, in _call_chain
result = func(*args)

File “/usr/lib/python2.7/”, line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)

File “/usr/lib/python2.7/”, line 1201, in do_open
r = h.getresponse(buffering=True)

File “/home/openstates/virt/local/lib/python2.7/site-packages/raven/”, line 375, in getresponse
rv = real_getresponse(self, *args, **kwargs)

File “/home/openstates/virt/local/lib/python2.7/site-packages/newrelic/hooks/”, line 74, in httplib_getresponse_wrapper
response = wrapped(*args, **kwargs)

File “/usr/lib/python2.7/”, line 1136, in getresponse

File “/usr/lib/python2.7/”, line 453, in begin
version, status, reason = self._read_status()

File “/usr/lib/python2.7/”, line 417, in _read_status
raise BadStatusLine(line)

BadStatusLine: ‘’


I am also having this error as of today (Aug 25th). Yesterday things were working fine. I am attempting to query legislators via lat and long.

Receiving status 500 errors and receiving page errors when using the search ui.

Any updates?


Still broken. I tested again today with no “fields” in the query string. Just the base, method, apiKey and location. Still returning 500.


I’m having the same problem.


Ditto as of the 25th.


Yup. I have run into this same error and using this API on multiple projects. Any updates on when it might be resolved?


I am also seeing this error, and it is affecting call-in campaigns for net neutrality and criminal justice. Is there an emergency contact who’s responsible for the API?


I tried their contact page for exactly emergencies…and it brings us here. So not sure how many admins have eyes on the site and how often they check it. But I’m somewhat hooped for launching this voter registration app until this bug gets squashed.


Hey all. Not sure what you are using this API for, but I am now exploring using Google Civic’s API as an alternative for at least doing local representative look ups. I haven’t found an alternative for state bill look up though, which I also need for one of my apps :confused:


The district boundary endpoint also appears to be down. Likely what is used behind the scenes for the geo endpoint.


… returns a Python error.


Throwing my project on the pile of affected apps.


@dwoo I also use the Google Civic Info API in my app to get info on Federal House Representatives. They never gave any state-only info, like the State House Representative, which is why I turned to Open States. BUT…as of a crash about a week ago with a beta tester’s app, Civic Info has suddenly added a few State Reps here and there – the overlap in one field was confusing my JSON parser, which is what caused the crash. But the majority of districts I tested still don’t have it. Anyway, it’s a good API.


Hey guys, really sorry for the trouble & delay. I’ve been out of town and the emergency monitoring didn’t trigger since the rest of the API is up. Working on fixing this and we’ll look at adding special monitoring for just this endpoint ASAP.


Thanks a million, James! Super happy to hear that help is on the way!


OK the Geo API is back up- looks like there was an issue connecting to the DB from that machine after a forced restart of the EC2 instance. Should be fine now but I’ll keep an eye on it & work on some additional monitoring this week


Can confirm. Purring like a kitten. Thanks!


Thanks @james! All apps are working perfectly now :slight_smile:

@Mike, yeah I just checked and Google Civic API is pretty spotty with local representative data. I use both in this app ( so you can compare the two API’s based on an address. I’d say about 70% of the time Google has local reps.


@dwoo Very useful info tool, that is!


Thanks for getting us back up and running, @james. You rock! :clap: :clap: :clap: