VertNet / api-geospatial

Code for the Geospatial Data Quality REST API for Primary Biodiversity Data
GNU General Public License v2.0
5 stars 2 forks source link

API throwing exceptions #5

Open tucotuco opened 8 years ago

tucotuco commented 8 years ago

This morning I noticed that the Spatial quality tab in VertNet was showing "Could not be assessed" for spatial quality tests that should have been functional. Trying the API, I found that it was throwing the exception below for the example query:

http://api-dev.vertnet-portal.appspot.com/geospatial?decimalLatitude=42.332&decimalLongitude=-1.833&countryCode=ES&scientificName=Puma%20concolor

Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in call rv = self.handle_exception(request, response, e) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in call rv = self.router.dispatch(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in call return handler.dispatch() File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(_args, *_kwargs) File "/base/data/home/apps/s~vertnet-portal/api-dev:20160229t123035.391042141687649866/geospatial/GeospatialIssue.py", line 45, in get fl = ast.literal_eval(result.content) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/ast.py", line 49, in literal_eval node_or_string = parse(node_or_string, mode='eval') File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "", line 1

^ SyntaxError: invalid syntax
jotegui commented 8 years ago

Thanks for noticing. I can confirm the issue. Will work on that!

--Javier Otegui - PGPID: AA372F68 http://www.jotegui.com

On Wed, Jul 13, 2016 at 9:55 AM, John Wieczorek notifications@github.com wrote:

Assigned #5 https://github.com/VertNet/api-geospatial/issues/5 to @jotegui https://github.com/jotegui.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VertNet/api-geospatial/issues/5#event-721198956, or mute the thread https://github.com/notifications/unsubscribe/AAnMoq4XyTDH_c93L1U1nq0j-A4mQtYEks5qVJoHgaJpZM4JLJ4e .

jotegui commented 8 years ago

Bad thing. Checking the logs, it seems it's getting timeouts from the geonames API...

jotegui commented 8 years ago

Also, I found that for some reason I forgot to work data encoding. It's also throwing issues for the following querystring:

?decimalLatitude=&decimalLongitude=&countryCode=C%C3%B4te%20d'Ivoire&scientificName=Typhlops%20punctatus

Creating its own issue

jotegui commented 8 years ago

New bug found

This time it has to do with the taxonomic quality part, and has its source in MOL's infrastructure.

The API uses a table called gbif_taxonomy to retrieve the id of the taxon to check and compare against range maps. However, it seems this table is no longer available.

I've asked MOL staff, awaiting their response and a possible replacement for such table.

Meanwhile, please notice that the geospatial part of the API is working:

This works - http://api-geospatial.vertnet-portal.appspot.com/geospatial?decimalLatitude=5.6110000000&decimalLongitude=-1.5445000000&countryCode=Ghana

This doesn't - http://api-geospatial.vertnet-portal.appspot.com/geospatial?decimalLatitude=5.6110000000&decimalLongitude=-1.5445000000&countryCode=Ghana&scientificName=Puma%20concolor

Traceback (most recent call last): File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in call rv = self.handle_exception(request, response, e) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in call rv = self.router.dispatch(request, response) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in call return handler.dispatch() File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(*args, **kwargs) File "/base/data/home/apps/s~vertnet-portal/api-geospatial:prod.396862815999485067/geospatial/GeospatialIssue.py", line 45, in get fl = ast.literal_eval(result.content) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_dist/lib/python2.7/ast.py", line 49, in literal_eval node_or_string = parse(node_or_string, mode='eval') File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3b44e98ed7fbb86b/python27/python27_dist/lib/python2.7/ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "", line 1

tucotuco commented 8 years ago

The spatial data quality aspects of the VertNet portal were hidden while resolution is sought.