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
IndexError
when trying to use "special access" ESO archive query ("cas" url)
#2994
Comments
@vandalt my best guess is that the immediate issue comes from the fact that not all ESO APIs support JWT tokens as authentication method. While download of the files, calselector, datalink and TAP accept them, WDB query interface might not (maybe @almicol can confirm this). An immediate hacky solution to your problem could be to visit the page in your browser while authenticated and extracting the session cookie (in most browsers it's something like F12 -> Data -> Cookies) and then including this cookie in the request (I'm not sure how you can set/pass those exactly in the astroquery code but there probably is some parameter for that). Another option could be to use Basic Auth header, but I'm not sure if WDB handle that or not. |
Hi Thomas, The astroquery.eso module has never officially supported special access, though the trick of configuring the end point to /cas instead of /eso indeed worked on version < 0.4.7. To extend the functionality of the module, following the evolution of the archive, we have started revamping it, and decided to change first the data retrieval and authentication parts, now available in version 0.4.7, leaving for a second stage the upgrade of the query part. During this transition phase, the /eso => /cas trick cannot work, because of the different authentication method. WDB does not support basic authentication. As said, the query part will use TAP, though this activity has to still find a time slot. At the moment I am working to expose all the instrument-specific tables via TAP, a pre-requisite step; later a software engineer will upgrade the module. In conclusion:
|
Hi!
When using the
Eso
class to access the regular "raw" archive,everything works as expected (see first snippet below).
However, when using the "special access" archive by setting
QUERY_INSTRUMENT_URL = "http://archive.eso.org/wdb/wdb/cas"
, I get anIndexError: list index out of range
(see second snippet below, showing full error message as well). The error does not occur withastroquery<0.4.7
.I tried to investigate a bit more. The issue seems to be that the session is authenticated only at download time (here), but not when retrieving the file table. More specifically, the
self._request()
call inself.query()
to getinstrument_form
seems to cause the issue (here). For the main archive, which requires no auth to get a table, I get a form webpage, as expected. However, for the special archive, I get the login page in the response. I tried setting theheaders
kwarg manually but that did not work.I have a minimal example showing this in the third snippet.
Currently, my solution to access the special (CAS) archive is to use PyVO to directly do an authenticated TAP query (following the "programmatic access" examples from here).
The fact that the special access worked for version prior to 0.4.7 leads me think the issue is related to #2681, so I'll include @szampier, @almicol and @Pharisaeus and @bsipocz who were involved in the discussion for that PR.
I was wondering:
Thank you!
Snippet 1: Working example with the main archive
Snippet 2: Working example with the special archive (but working with `astroquery<0.4.7`
Which gives the following error
Snippet 3: Example requests to get instrument form
The first block gives an HTML form, the last two a login page.
The text was updated successfully, but these errors were encountered: