<type 'exceptions.KeyError'>
Python 2.7.13: /usr/bin/python
Fri Apr 24 08:05:17 2020

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.Request object>)
    556         """Runs the handler, flushes the streams, and ends the request."""
    557         try:
=>  558             protocolStatus, appStatus = self.server.handler(self)
    559         except:
    560             traceback.print_exc(file=self.stderr)
protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.Request object>, self.server = <flup.server.fcgi_fork.WSGIServer object>, self.server.handler = <bound method WSGIServer.handler of <flup.server.fcgi_fork.WSGIServer object>>
 /usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi_fork.WSGIServer object>, req=<flup.server.fcgi_base.Request object>)
   1116         try:
   1117             try:
=> 1118                 result = self.application(environ, start_response)
   1119                 try:
   1120                     for data in result:
result = None, self = <flup.server.fcgi_fork.WSGIServer object>, self.application = <function myapp>, environ = {'CONTENT_LENGTH': '0', 'DOCUMENT_ROOT': '/data/project/phetools/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'tools.wmflabs.org', 'HTTP_USER_AGENT': 'GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1', 'HTTP_X_FORWARDED_HOST': 'tools.wmflabs.org', 'HTTP_X_FORWARDED_PORT': '443', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_ORIGINAL_URI': '/phetools/pdf_to_djvu_cgi.py?cmd=get&ia_id=THBarker_1903-11-23', ...}, start_response = <function start_response>
 /mnt/nfs/labstore-secondary-tools-project/phetools/phe/ocr/pdf_to_djvu_cgi.py in myapp(environ={'CONTENT_LENGTH': '0', 'DOCUMENT_ROOT': '/data/project/phetools/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'tools.wmflabs.org', 'HTTP_USER_AGENT': 'GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1', 'HTTP_X_FORWARDED_HOST': 'tools.wmflabs.org', 'HTTP_X_FORWARDED_PORT': '443', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_ORIGINAL_URI': '/phetools/pdf_to_djvu_cgi.py?cmd=get&ia_id=THBarker_1903-11-23', ...}, start_response=<function start_response>)
    177         return handle_query(params, start_response)
    178     elif params['cmd'] == 'get':
=>  179         return handle_get(environ, params, start_response)
    180     elif params['cmd'] == 'help':
    181         return handle_help(start_response)
global handle_get = <function handle_get>, environ = {'CONTENT_LENGTH': '0', 'DOCUMENT_ROOT': '/data/project/phetools/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'tools.wmflabs.org', 'HTTP_USER_AGENT': 'GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1', 'HTTP_X_FORWARDED_HOST': 'tools.wmflabs.org', 'HTTP_X_FORWARDED_PORT': '443', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_ORIGINAL_URI': '/phetools/pdf_to_djvu_cgi.py?cmd=get&ia_id=THBarker_1903-11-23', ...}, params = {'cmd': 'get', 'format': 'text', 'ia_id': 'THBarker_1903-11-23'}, start_response = <function start_response>
 /mnt/nfs/labstore-secondary-tools-project/phetools/phe/ocr/pdf_to_djvu_cgi.py in handle_get(environ={'CONTENT_LENGTH': '0', 'DOCUMENT_ROOT': '/data/project/phetools/public_html/', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'tools.wmflabs.org', 'HTTP_USER_AGENT': 'GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1', 'HTTP_X_FORWARDED_HOST': 'tools.wmflabs.org', 'HTTP_X_FORWARDED_PORT': '443', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_ORIGINAL_URI': '/phetools/pdf_to_djvu_cgi.py?cmd=get&ia_id=THBarker_1903-11-23', ...}, params={'cmd': 'get', 'format': 'text', 'ia_id': 'THBarker_1903-11-23'}, start_response=<function start_response>)
    109         return [ text ]
    110 
=>  111     ia_files = pdf_to_djvu.get_ia_files(params['ia_id'])
    112     if not ia_files.get('pdf', None) or not ia_files.get('xml', None):
    113         text = json.dumps(
ia_files undefined, global pdf_to_djvu = <module 'pdf_to_djvu' from '/mnt/nfs/labstore-se...-tools-project/phetools/phe/ocr/pdf_to_djvu.pyc'>, pdf_to_djvu.get_ia_files = <function get_ia_files>, params = {'cmd': 'get', 'format': 'text', 'ia_id': 'THBarker_1903-11-23'}
 /mnt/nfs/labstore-secondary-tools-project/phetools/phe/ocr/pdf_to_djvu.py in get_ia_files(ia_id='THBarker_1903-11-23')
    211         # this one exists in old and new items
    212         if d['format'] == 'Djvu XML':
=>  213             result['xml'] = { 'name' : d['name'], 'sha1' : d['sha1'] }
    214         # 'Additional Text PDF' format exists only in new items but in old
    215         # items the .djvu must exist and should be used directly. For older
result = {'pdf': None, 'xml': None}, d = {u'format': u'Djvu XML', u'name': u'Letter_from_T.H._Barker_to_his_wife_Mary,_23_November_1903_djvu.xml', u'original': u'Letter_from_T.H._Barker_to_his_wife_Mary,_23_November_1903_abbyy.gz', u'source': u'derivative'}

<type 'exceptions.KeyError'>: 'sha1'
      args = ('sha1',)
      message = 'sha1'