django-daiquiri / daiquiri

A framework for the publication of scientific databases
https://escience.aip.de/daiquiri
Apache License 2.0
26 stars 8 forks source link

IMPROVEMENT: get server side errror message when using PyVO #158

Open agy-why opened 1 year ago

agy-why commented 1 year ago

PyVo provides an interface to return server side error message while using DalServices: ErrorSummary. The later was broken but has been repaired in #155.

The problem however is that Daiquiri returns a 404 when starting job fails. For PyVO it means that the Client failed and a Client Error is returned. see: https://github.com/astropy/pyvo/blob/main/pyvo/dal/tap.py#L871

Instead Daiquiri should return a 200 with valid Job XML and Error Message.

The drawback is that more Failing Jobs will be generated. The advantage being that the error messages will be much clearer.

Alternatively the error could be propagated there: (but still not clear workflow). https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/jobs/renderers.py#L83

The problem may come from here: https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/jobs/viewsets.py#L118

  1. job is create
  2. job is processed (check quotas, user, translate query...)

The problem is here: when a non-existing column or table is requested it will fail here: https://github.com/django-daiquiri/daiquiri/blob/686352c80ad8d269c519b9d93f62e68cf874e625/daiquiri/query/process.py#L202

For a Syntax issue here: https://github.com/django-daiquiri/daiquiri/blob/686352c80ad8d269c519b9d93f62e68cf874e625/daiquiri/query/process.py#L194

There are 3 related problems:

  1. the error information get lost between QueryError and UWSErrorRenderer.
  2. the job is destroyed and therefore the error can not be retrieved aposteriori.
  3. The response is a 404 which leads to a Client Error from PyVO although it is a server side error.