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


#1

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: https://openstates.org/api/v1/legislators/geo/?apikey=xxxxxxxxxxx&long=-93.327087&fields=boundary_id,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/component_piston.py”, line 33, in call
return self._nr_wrapped(*args, **kwargs)

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

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

File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)

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

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

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

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

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

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

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

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

File “/usr/lib/python2.7/httplib.py”, line 1136, in getresponse
response.begin()

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

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

BadStatusLine: ‘’


#2

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 openstates.org search ui.

Any updates?


#3

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


#4

I’m having the same problem.


#5

Ditto as of the 25th.


#6

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


#7

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?


#8

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.


#9

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:


#10

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

/districts/boundary/sldl/nc-120/

… returns a Python error.


#11

Throwing my project on the pile of affected apps.


#12

@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.


#13

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.


#14

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


#15

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


#16

Can confirm. Purring like a kitten. Thanks!


#17

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 (https://remix4change.glitch.me/) so you can compare the two API’s based on an address. I’d say about 70% of the time Google has local reps.


#18

@dwoo Very useful info tool, that is!


#19

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