ncbo / bioportal_web_ui

A Rails application for biological ontologies
http://bioportal.bioontology.org/
Other
21 stars 2 forks source link

ArgumentError (`render file:` should be given the absolute path to a file. '/ontologies/visualize' was given instead) #252

Closed alexskr closed 1 year ago

alexskr commented 1 year ago

we are seeing a number of the following errors in the logs:

[f52bf212-c4b9-40da-8c6e-157fc20838d4] ArgumentError (`render file:` should be given the absolute path to a file. '/ontologies/visualize' was given instead):
[f52bf212-c4b9-40da-8c6e-157fc20838d4]
[f52bf212-c4b9-40da-8c6e-157fc20838d4] app/controllers/concepts_controller.rb:35:in `show'
jvendetti commented 1 year ago

Adding more information since it took me a while to figure out how to reproduce this error in my local dev environment. The URL pattern that triggers the above code is /ajax_concepts/:ontology, and you need to pass a valid class id as part of the query string, e.g.:

http://localhost:3000/ajax_concepts/BRO?id=http%3A%2F%2Fbioontology.org%2Fontologies%2FActivity.owl%23Activity.

I couldn't find any functionality in the current Rails application that will generate a request with this pattern. Maybe I'm missing something though.

syphax-bouazzouni commented 1 year ago

Hi @jvendetti , I met with this call while working on this https://github.com/ncbo/bioportal_web_ui/pull/223

And I think that this is where it is called

image

The request parameter for concept id can be id like in your example, but also conceptid (see https://github.com/ncbo/bioportal_web_ui/blob/master/app/controllers/concepts_controller.rb#L10)

It is used to get concept/class details in ajax by the ontology_viewer, when you click for a concept in the tree view.

The bug occurs when you try to access that link with a regular call, which will call the no-more-used block (the else block) https://github.com/ncbo/bioportal_web_ui/blob/master/app/controllers/concepts_controller.rb#L35

I hope this help (and that I'm not off topic)

jvendetti commented 1 year ago

Thanks for the additional details Syphax. I had assumed there would be a way to manually trigger the else block beginning on line 26 from the Rails application.

Our New Relic monitoring software is reporting a large number of errors from this URL pattern that come in as regular calls and trigger the else block. Roughly 7K errors over the last 7 days:

Screen Shot 2023-01-30 at 3 26 50 PM