pyLODE icon indicating copy to clipboard operation
pyLODE copied to clipboard

Internal Server Error when processing resource

Open lewismc opened this issue 5 years ago • 5 comments

We have pyLODE master branch running as a service at http://cor.esipfed.org/pylode

The following resource triggers an Internal Server Error

http://cor.esipfed.org/pylode?url=http://cor.esipfed.org/ont/api/v0/ont%3Firi=http://purl.dataone.org/provone/2015/01/15/ontology%23

This does not generate any log so I am struggling to debug what the issue actually is.

I know the service is stable and as other resources render correctly for example http://cor.esipfed.org/pylode?url=http://cor.esipfed.org/ont/api/v0/ont%3Firi=http://sweetontology.net/stateSpaceScale

lewismc avatar Aug 10 '20 20:08 lewismc

Have another look at your identifier after the 'iri='. I don't think it's valid.

graybeal avatar Aug 10 '20 22:08 graybeal

We've been having a long chat on the slack channel where Lewis brought this up. The identifier of the ontology (not just the namespace) ends in # (which I think is goofy but I won't out-argue the W3C). So when we escape the # in COR I believe the purl resolver is not reconstituting it into a #. I'm not making the argument that the purl resolver is wrong; I'm just not sure what the right answer is. As I say, we're discussing it. :-)

graybeal avatar Aug 10 '20 23:08 graybeal

But maybe once we figure out what pylode gets from the purl server, you can handle it with something that mentions the purl server error, to take the heat off of pylode. :-)

graybeal avatar Aug 10 '20 23:08 graybeal

@nicholascar The cause of the issue is a missing URL-encoding for a proper request in this line:

https://github.com/RDFLib/pyLODE/blob/c9581dbc1df0caa0d8f823872dafd2e47e476435/pylode/common.py#L103

In our local pyLODE copy I just added a line with the specific # -> %23 replacement:

image

and this solves our most immediate problem. A more proper solution would involve a general url-encoding of the query string.

carueda avatar Aug 13 '20 17:08 carueda

I'll submit a PR shortly @carueda thank you.

lewismc avatar Aug 13 '20 18:08 lewismc