OpenGeoscience / geoweb

Open source geoscience tools and applications
8 stars 3 forks source link

ESGF query fails sometimes #147

Closed benbu closed 10 years ago

benbu commented 10 years ago
HTTP Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/Library/Python/2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/Users/benbu/src/climatepipes/build/deploy/geoweb.py", line 73, in esgf
    return esgf.run(*args, **kwargs)
  File "/Users/benbu/src/climatepipes/build/deploy/modules/esgf/__init__.py", line 45, in run
    'data': [streams[streamId].next()] };
  File "/Users/benbu/src/climatepipes/build/deploy/modules/esgf/query.py", line 29, in query
    url = _extract_url(node);
  File "/Users/benbu/src/climatepipes/build/deploy/modules/esgf/query.py", line 16, in _extract_url
    return doc_node.xpathEval('./arr[@name="url"][1]/str/text()')[0].get_content()
IndexError: list index out of range

If I quickly change my query string, I get this in the logs sometimes. For example, type 'c', backspace, 'e', backspace, 'd', .... It generates a 500 server error in the browser and this error/stacktrace on the server.

cjh1 commented 10 years ago

Should be fixed by 147-fix-esgf-search-failures. I add a guard ( as some data sets don't have urls associated with them )

benbu commented 10 years ago

Approved

benbu commented 10 years ago

I'll reopen until @aashish24 merges to master.

aashish24 commented 10 years ago

Merged! Thanks @cjh1 @benbu