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

Cache issues with JPLhorizons #2237

Closed
Mdevogele opened this issue Dec 3, 2021 · 3 comments
Closed

Cache issues with JPLhorizons #2237

Mdevogele opened this issue Dec 3, 2021 · 3 comments

Comments

@Mdevogele
Copy link

Hi,

I encountered this issue with JPLHorizons, but it might be present for other services.

For a brief moment, the Horizons API was returning errors to my queries.
Those queries have been stored in the cache although astroquery was recognizing them as faulty queries.
It resulted that when the issue was fixed on the Horizons side, my astroquery queries were still returning the same error as it was using the cache and was not trying to query Horizons again.

I thus had to add a try and catch to all my programs to avoid this issue and using a cache=False when the regular call with the cache fails while this could be built in the JPLHorizons module to not store the cache when the query fails

For the example, here was the error that the JPLHorizons was returning to me was:

ValueError: Query failed without known error message; received the following response:
BATVAR: no TLIST values found (or missing quotes)
WLDINI: error loading execution-control file.

Thanks!

@msakikasm
Copy link

I have had the same issue. Did you find the way to fix this? @Mdevogele

@Mdevogele
Copy link
Author

Mdevogele commented Dec 15, 2021

I did not fix it inside astroquery itself, but I got around it by using a try and except
If the request fails with a ValueError, it tries again without looking for a cache file.

try: eph = obj.ephemerides() except ValueError: eph = obj.ephemerides(cache=False)

@bsipocz
Copy link
Member

bsipocz commented Dec 17, 2021

cc @mkelley, though this is not a unique issue to jplhorizons and @keflavich added a fix for the same issue for simbad in #2187, something similar should do the trick here.

mkelley added a commit to mkelley/astroquery that referenced this issue Dec 20, 2021
bsipocz added a commit that referenced this issue Dec 25, 2021
Fix for issue #2237: do not cache results that cannot be parsed.
@bsipocz bsipocz closed this as completed Dec 25, 2021
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this issue Mar 11, 2022
mhsarmiento pushed a commit to esdc-esac-esa-int/astroquery that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants