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

Invalid ESGF query for CERES-EBAF datasets #2142

Closed
rbeucher opened this issue Jul 17, 2023 · 12 comments
Closed

Invalid ESGF query for CERES-EBAF datasets #2142

rbeucher opened this issue Jul 17, 2023 · 12 comments
Assignees
Labels
bug Something isn't working observations
Milestone

Comments

@rbeucher
Copy link
Contributor

Hi All,

So I cam across an issue affection quite a few recipes. When CERES-EBAF data are missing, the code sends an ESGF query with an empty time_frequency argument:

Starting new HTTPS connection (1): esgf.ceda.ac.uk:443 2023-06-08 07:19:48,809 UTC [176196] DEBUG https://esgf.ceda.ac.uk:443 "GET /esg-search/search?format=application%2Fsolr%2Bjson&limit=500&distrib=true&offset=0&type=File&project=obs4MIPs&source_id=CERES-EBAF&time_frequency=&variable=swcre HTTP/1.1" 400 832

This results in an invalid query.

files = esgf_search_files(esgf_facets) File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/esmvalcore/esgf/_search.py", line 150, in esgf_search_files results = _search_index_nodes(facets) File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/esmvalcore/esgf/_search.py", line 119, in _search_index_nodes results = context.search( File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/pyesgf/search/context.py", line 141, in search return ResultSet(sc, batch_size=batch_size) File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/pyesgf/search/results.py", line 42, in __init__ self.__get_batch(0) File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/pyesgf/search/results.py", line 82, in __get_batch response = (self.context.connection File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/pyesgf/search/connection.py", line 159, in send_search response = self._send_query('search', full_query) File "/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/lib/python3.10/site-packages/pyesgf/search/connection.py", line 210, in _send_query raise Exception("Invalid query parameter(s): %s" % content) Exception: Invalid query parameter(s): 2023-06-08 07:19:49,563 UTC [176196] INFO

I know the CERES-EBAF observation dataset is affected by issue ESMValGroup/ESMValTool#2974 but this seems unrelated.

Recipes affected are:

recipe_autoassess_landsurface_surfrad
recipe_clouds_ipcc
recipe_cmug_h2o
recipe_deangelis15nat
recipe_flato13ipcc_figures_92_95
recipe_lauer13jclim
recipe_perfmetrics_CMIP5
recipe_validation
recipe_wenzel16jclim

@valeriupredoi
Copy link
Contributor

many thanks for raising this @rbeucher - am gonna move this to ESMValCore since the bug needs a fix plopped in there 👍

@valeriupredoi valeriupredoi transferred this issue from ESMValGroup/ESMValTool Jul 17, 2023
@valeriupredoi valeriupredoi added bug Something isn't working observations labels Jul 17, 2023
@valeriupredoi valeriupredoi added this to the v2.10.0 milestone Jul 17, 2023
@valeriupredoi
Copy link
Contributor

Hi again @rbeucher - the faceted search is populated correctly when I run a test of recipe_validation.yml with the latest development installation of both ESMValCore and ESMValTool (see below); are you using any special credentials to connect to ESGF? Also, could you please post the output of esmvaltool version here and also the output for conda list esgf? Cheers 🍺

2023-07-17 13:13:44,180 UTC [29443] DEBUG   Searching https://esgf.ceda.ac.uk/esg-search for datasets using facets={'project': 'obs4MIPs', 'source_id': 'CERES-EBAF', 'time_frequency': 'mon', 'variable': 'rsut'}
2023-07-17 13:13:44,180 UTC [29443] DEBUG   Initializing backend: None /home/valeriu/.esmvaltool/cache/pyesgf-search-results
2023-07-17 13:13:44,180 UTC [29443] DEBUG   Initialized SQLiteDict with serializer: SerializerPipeline(name=pickle, n_stages=2)
2023-07-17 13:13:44,180 UTC [29443] DEBUG   Opening connection to /home/valeriu/.esmvaltool/cache/pyesgf-search-results.sqlite:responses
2023-07-17 13:13:44,181 UTC [29443] DEBUG   Initialized SQLiteDict with serializer: None
2023-07-17 13:13:44,181 UTC [29443] DEBUG   Opening connection to /home/valeriu/.esmvaltool/cache/pyesgf-search-results.sqlite:redirects
2023-07-17 13:13:44,185 UTC [29443] DEBUG   Cache directives from request headers: CacheDirectives()
2023-07-17 13:13:44,185 UTC [29443] DEBUG   Pre-read cache checks: Passed
2023-07-17 13:13:44,186 UTC [29443] DEBUG   Post-read cache actions: CacheActions(expire_after=86400)
2023-07-17 13:13:44,186 UTC [29443] DEBUG   Closing backend connections
2023-07-17 13:13:44,187 UTC [29443] DEBUG   Correcting facet 'modeling_realm' from 'None' to 'atmos' for obs4MIPs.CERES-EBAF.v20160610.rsut_CERES-EBAF_L3B_Ed2-8_200003-201404.nc
2023-07-17 13:13:44,187 UTC [29443] DEBUG   Correcting facet 'version' from 'None' to 'v20160610' for obs4MIPs.CERES-EBAF.v20160610.rsut_CERES-EBAF_L3B_Ed2-8_200003-201404.nc
2023-07-17 13:13:44,187 UTC [29443] DEBUG   Found the following files matching facets {'project': 'obs4MIPs', 'source_id': 'CERES-EBAF', 'time_frequency': 'mon', 'variable': 'rsut'}: 
ESGFFile:obs4MIPs/CERES-EBAF/v20160610/rsut_CERES-EBAF_L3B_Ed2-8_200003-201404.nc on hosts ['dpesgf03.nccs.nasa.gov']
2023-07-17 13:13:44,187 UTC [29443] DEBUG   Selected files:
ESGFFile:obs4MIPs/CERES-EBAF/v20160610/rsut_CERES-EBAF_L3B_Ed2-8_200003-201404.nc on hosts ['dpesgf03.nccs.nasa.gov']
2023-07-17 13:13:44,188 UTC [29443] DEBUG   Using input files for variable rsut of dataset obs4MIPs:
/home/valeriu/climate_data/obs4MIPs/CERES-EBAF/v20160610/rsut_CERES-EBAF_L3B_Ed2-8_200003-201404.nc (will be downloaded)

@rbeucher
Copy link
Contributor Author

Hi @valeriupredoi ,

Here are the details.
Curious that esmvaltool version returns a dev version. I am working in a conda environment, installed via conda-forge.

Singularity> esmvaltool version
ESMValCore: 2.9.0
ESMValTool: 2.9.0.dev48+g7e0c5a5b6
Singularity> which esmvaltool
/g/data/xp65/public/apps/med_conda/envs/access-med-0.1/bin/esmvaltool
Singularity> conda list esmvaltool
# packages in environment at /g/data/xp65/public/apps/med_conda/envs/access-med-0.1:
#
# Name                    Version                   Build  Channel
esmvaltool                2.9.0              pyhd8ed1ab_0    conda-forge
esmvaltool-ncl            2.9.0                hd8ed1ab_0    conda-forge
esmvaltool-python         2.9.0              pyhd8ed1ab_0    conda-forge
esmvaltool-r              2.9.0                hd8ed1ab_0    conda-forge
Singularity> conda list esgf
# packages in environment at /g/data/xp65/public/apps/med_conda/envs/access-med-0.1:
#
# Name                    Version                   Build  Channel
esgf-pyclient             0.3.1              pyh1a96a4e_2    conda-forge
Singularity> 

@rbeucher
Copy link
Contributor Author

I am not using any specific credentials.

@valeriupredoi
Copy link
Contributor

I am rather baffled - I have reproduced the install process you have (just in case there may be an issue with our deployed version - was dreading it haha) and all still works for me though - could you please understand why you have a dev version for esmvaltool? It shouldn't matter since all the esgf stuff is happening inside esmvaltool, but that's no bueno for a conda install to have any other version than stable 2.9.0. Can you maybe try and install esmvaltool yourself, w/o relying on a central install via a container, and rerun exactly this - I am using the recipe_validation.yml as my test bed 🍺 Installing is easy (from conda), see instructions here https://docs.esmvaltool.org/en/latest/quickstart/installation.html#install-on-linux

@valeriupredoi
Copy link
Contributor

installing the tool by yourself ensures that no code tampering happened (by whoever installed it on the system), and may expose what @remi-kazeroni mentions here ESMValGroup/ESMValTool#3293 (comment)

@rbeucher
Copy link
Contributor Author

rbeucher commented Jul 19, 2023 via email

@rbeucher
Copy link
Contributor Author

So I can confirm that I am using 2.9.0 not a Dev version. The version command was picking up a remnant of a Dev installation in my '.local' folder.

@valeriupredoi
Copy link
Contributor

that's not good ie having old installs/other dependencies still in path - makes me wonder what else is there in the path that may lead to a bit of a strange behaviour. Do you have access to an HPC perhaps? It'd be good to test there - or even a different machine where you plop a fresh installation from scratch, if you have such access - am afraid that, without being able to replicate the issue, I can't do much more, since this could be caused by things that I can't even think of - maybe @schlunma @remi-kazeroni or @bouweandela (when he's back from holidays) can help a bit more? 🍺

@rbeucher
Copy link
Contributor Author

Yes I have reinstalled. It is a fresh conda installation and it's on HPC. We need to install a development version for debugging and development anyway so I'll get back to you when I find the root of the issue.

This is part of our effort to have a data pool and automated runs or the ESMValTool recipes at NCI / ACCESS-NRI. Hopefully we will have something similar to what you have at DKRZ soon and will be able to contribute.

@rbeucher
Copy link
Contributor Author

@valeriupredoi It was indeed an issue with the DRS in the config-developer file. Thanks for pointing me toward this. I am closing this now.

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Jul 21, 2023

oh man, big PHEW - was fast running out of ideas 😁 Great you figured it out and cheers muchly @remi-kazeroni for thinking of the possible hiccup! Welcome to ESMValTool (through brimstone and fire) 😁 Cheers for closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working observations
Projects
None yet
Development

No branches or pull requests

3 participants