OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
87 stars 18 forks source link

invalid literal for int() in resolve_pinpoint_to_row #847

Open hyanwong opened 4 months ago

hyanwong commented 4 months ago

I'm seeing this in the logs:

<class 'ValueError'> invalid literal for int() with base 10: 'Melainabacteria_group=5268478'
Traceback (most recent call last):
  File "/usr/home/web2py/www.onezoom.org/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/compiled/controllers.API.pinpoints.py", line 896, in <module>
  File "/usr/home/web2py/www.onezoom.org/gluon/globals.py", line 463, in <lambda>
    self._caller = lambda f: f()
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/compiled/controllers.API.pinpoints.py", line 148, in pinpoints
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/modules/pinpoint.py", line 61, in resolve_pinpoint_to_row
    node_query = db.ordered_nodes.ott == int(pinpoint)
davidebbo commented 4 months ago

5268478 is Cyanobacteria/Melainabacteria group. Initial thought is that the slash in the pseudo-taxon is throwing something off.

In the newick, it looks like 'Cyanobacteria/Melainabacteria_group_ott5268478'.

That being said, there are quite a few entries with a /, so maybe there is more to it.

lentinj commented 4 months ago

The slash is a very good point. A URL like https://beta.onezoom.org/API/pinpoints.json/@Cyanobacteria/Melainabacteria_group=5268478 goes bang in the way you'd expect. We try and treat each half as a pinpoint, and the latter half doesn't look like a valid OTT:

https://github.com/OneZoom/OZtree/blob/fa65779fcd6a37cd6658e3fd21b07568ea023a17/modules/pinpoint.py#L59-L62

There's not that much that can be done within the API. The damage is done by this point, so we'd need to figure out what's calling it with a malformed URL.