Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAPService run_async() fails when the result URI is relative #191

Closed
streeto opened this issue Oct 31, 2019 · 1 comment · Fixed by #192
Closed

TAPService run_async() fails when the result URI is relative #191

streeto opened this issue Oct 31, 2019 · 1 comment · Fixed by #192

Comments

@streeto
Copy link
Contributor

streeto commented Oct 31, 2019

I am using CEFCA TAP services (currently only with authenticated access), and tried to make some async queries. I get this error:

MissingSchema: Invalid URL './21530/./results/result': No schema supplied. Perhaps you meant http://./21530/./results/result?

The job summary is like the following:

<uws:job xsi:schemaLocation="http://www.ivoa.net/xml/UWS/UWS-v1.0.xsd"
xmlns:xml = "http://www.w3.org/XML/1998/namespace"
xmlns:uws="http://www.ivoa.net/xml/UWS/v1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<uws:jobId>21529</uws:jobId>
<uws:ownerId>andre</uws:ownerId>
<uws:phase>PENDING</uws:phase>
<uws:quote>1</uws:quote>
<uws:startTime></uws:startTime>
<uws:endTime></uws:endTime>
<uws:executionDuration></uws:executionDuration>
<uws:destruction>2019-11-04 18:38:31.409070</uws:destruction>
<uws:parameters>
<uws:parameter id="QUERY">select * from minijpas.filter</uws:parameter>
<uws:parameter id="MAXREC">1000000</uws:parameter>
<uws:parameter id="FORMAT">votable</uws:parameter>
<uws:parameter id="LANG">ADQL</uws:parameter>
</uws:parameters>
<uws:results>
<uws:result id="main" xlink:href="./21529/./results/result"/>
</uws:results>
<uws:jobInfo>
</uws:jobInfo>
</uws:job>

After some tests, I made a hotfix to prepend the request URL (AsyncTAPJob.url) to the result URL if the job URL is not absolute, and it worked. I am not sure wether the spec requires an absolute URL or allows a relative one. I can make a pull request if this solution is correct.

I also tested with Topcat, works out of the box.

For reference, I am using the method for authentication described in examples/auth/gaia_auth_example.py.

@cbanek
Copy link
Contributor

cbanek commented Oct 31, 2019

Hi there @streeto , thank you so much for filing an issue.

I just gave a quick look through the UWS spec, and I don't see a lot of info one way or the other on if it should be an absolute URL or could also be relative. It seems that if TOPCAT works, that it might be part of the spec, although again, I'm not sure.

Since you've already done the work of making a fix (and tested it), I would suggest that you make a PR, so we can at least see what is going on in the code - it seems like a pretty small targeted fix, but I just want to confirm that.

I'll try to ask around to see if there's any strong opinions on the UWS spec, I'll email Mark Taylor and the GWS list to see if anyone chimes in.

streeto added a commit to streeto/pyvo that referenced this issue Oct 31, 2019
…ync job with a relative result URL.

Some TAP services return a JobSummary containing relative URLs for results, leading to an exception like the following:

`MissingSchema: Invalid URL './21530/./results/result': No schema supplied. Perhaps you meant http://./21530/./results/result?`

If the result URL is relative, we have to prepend the async TAP request URL to it before fetching the results.

Fixes astropy#191.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants