equinor / ert

ERT - Ensemble based Reservoir Tool - is designed for running ensembles of dynamical models such as reservoir models, in order to do sensitivity analysis and data assimilation. ERT supports data assimilation using the Ensemble Smoother (ES), Ensemble Smoother with Multiple Data Assimilation (ES-MDA) and Iterative Ensemble Smoother (IES).
https://ert.readthedocs.io/en/latest/
GNU General Public License v3.0
102 stars 107 forks source link

KeyError in storage, key with angular brackets #8966

Open berland opened 2 days ago

berland commented 2 days ago

What happened? (You can include a screenshot if it helps explain)

Someone running Ert yielded the following log:

File "/prog/res/komodo/2024.09.03-py38-rhel8/root/lib64/python3.8/site-packages/ert/dark_storage/endpoints/records.py", line 76, in get_ensemble_record
    dataframe = data_for_key(storage.get_ensemble(ensemble_id), name)
  File "/prog/res/komodo/2024.09.03-py38-rhel8/root/lib64/python3.8/site-packages/ert/dark_storage/common.py", line 129, in data_for_key
    data = data[key].to_frame().dropna()
  File "/prog/res/komodo/2024.09.03-py38-rhel8/root/lib64/python3.8/site-packages/pandas/core/frame.py", line 3807, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/prog/res/komodo/2024.09.03-py38-rhel8/root/lib64/python3.8/site-packages/pandas/core/indexes/base.py", line 3804, in get_loc
    raise KeyError(key) from err
KeyError: 'PORO_MULT:<MULTRGTPORO_3>'
 from url: http://127.0.0.1:51838/ensembles/8550c77xxxxxxxxxxx15ef996b/records/PORO_MULT:%3CMULTRGTPORO_3%3E.

What did you expect to happen?

This looks like some extra angular brackets that are placed somehere in the config. This error should be picked up by validation so that this exception cannot occur.

steps to reproduce

No response

Environment where bug has been observed

eivindjahren commented 2 days ago

I think this might be fixed by https://github.com/equinor/ert/commit/372d5f6e9e2b21706fb4d141ff72c70f4adb9450