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

ISSUES with TopCat #197

Closed agy-why closed 1 year ago

agy-why commented 1 year ago

Hi Yori,

sorry about the slow response, I've just got back from a couple of weeks on holiday.

The error about an unclosed link tag relates to the examples document at https://gaia.aip.de/tap/examples. Although it doesn't explicitly say this in the TAP 1.1 specification, this document must be XHTML, i.e. well-formed XML (unlike HTML, close tags may not be omitted); this is written in sec 2.3 of DALI 1.1, to which the TAP examples document must conform. There are some unclosed elements in that document:

% curl -s https://gaia.aip.de/tap/examples | xmllint -noout - -:33: parser error : Opening and ending tag mismatch: link line 30 and head ^ -:1551: parser error : Opening and ending tag mismatch: link line 30 and html ^ -:1552: parser error : EndTag: '</' not found

which are causing the problem. That means that the machine-readable examples are not visible from topcat, though it doesn't itself break other things.

However, this error:

WARNING: Row count for TAP_SCHEMA.columns failed: java.io.IOException: Unexpected column count: 0 != 1

is reporting something different. The problem here is that the following query:

SELECT COUNT(*) AS nrow FROM TAP_SCHEMA.columns

which topcat does as part of the metadata acquisition returns a table with no columns. Looking at it (REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nrow+FROM+TAP_SCHEMA.columns) the problem seems to be that there is a missing FIELD element in the output.

If you run topcat with the flags "-verbose -verbose" you can see what it's doing in a way that may help you to diagnose problems.

Even better, run the stilts taplint command on your service (topcat -stilts taplint tapurl=https://gaia.aip.de/tap) which will show up these and other compliance issues in the service, with hopefully somewhat explanatory explanations - see http://www.starlink.ac.uk/stilts/sun256/taplint.html

Mark

TODO

agy-why commented 1 year ago

Typically this returns an unvalid VOTable: https://gaia.aip.de/tap/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nrow+FROM+TAP_SCHEMA.columns

Where FIELD (column info) are missing.

With async all is fine.

kimakan commented 1 year ago

Regarding the unclosed link tag, it seems that the django-compressor removes the closing tags. https://github.com/django-daiquiri/daiquiri/blob/33094c5389e0acb0b30fcc1db54b7bb6bafaf0c5/daiquiri/tap/templates/tap/examples.html#L7-L9 results in

<link rel="stylesheet" href="/static/CACHE/css/output.53dea850c36b.css" type="text/css">

It's also the case in the header https://github.com/django-daiquiri/daiquiri/blob/33094c5389e0acb0b30fcc1db54b7bb6bafaf0c5/daiquiri/core/templates/core/base_head.html#L22-L27 is compressed to

<link rel="stylesheet" href="/static/CACHE/css/output.caa75e54c6ac.css" type="text/css">