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

Unable to clean ensemble records - will put ert3 in an unrunnable state. #2731

Closed
lars-petter-hauge opened this issue Jan 18, 2022 · 3 comments
Labels

Comments

@lars-petter-hauge
Copy link
Contributor

lars-petter-hauge commented Jan 18, 2022

This issue could be irrelevant depending on #2707

Describe the bug
ert3 clean -all will not remove ensemble wide records.

A possible scenario is that an issue occurs while loading them into ert. Then there is no way to get back to a runnable state.

To Reproduce
Steps to reproduce the behavior:

  1. pip install ert
  2. ert3 init --examples polynomial
  3. ert3 record load designed_coefficients experiments/doe/coefficients_record.json

    ctrl+c cancel half way

At this point neither running an experiment, nor trying to clean and reload, will be possible
4. ert3 run doe

Traceback (most recent call last):
  File "/Users/LPHA/venvs/ert_env/bin/ert3", line 33, in <module>
    sys.exit(load_entry_point('ert', 'console_scripts', 'ert3')())
  File "/Users/LPHA/GitProjects/ert/ert3/console/_console.py", line 327, in main
    _main()
  File "/Users/LPHA/GitProjects/ert/ert3/console/_console.py", line 354, in _main
    _run(workspace, args)
  File "/Users/LPHA/GitProjects/ert/ert3/console/_console.py", line 218, in _run
    ert3.engine.run(experiment_run_config, workspace, args.experiment_name)
  File "/Users/LPHA/GitProjects/ert/ert3/engine/_run.py", line 173, in run
    transmitters = _gather_transmitter_maps(
  File "/Users/LPHA/GitProjects/ert/ert3/engine/_run.py", line 48, in _gather_transmitter_maps
    res = get_event_loop().run_until_complete(asyncio.gather(*futures))
  File "/usr/local/Cellar/[email protected]/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/LPHA/GitProjects/ert/ert/storage/_storage.py", line 165, in get_record_storage_transmitters
    transmitters, collection_type = await _get_record_storage_transmitters(
  File "/Users/LPHA/GitProjects/ert/ert/storage/_storage.py", line 129, in _get_record_storage_transmitters
    record_type = metadata["record_type"]
KeyError: 'record_type'
  1. ert3 clean --all
  2. ert3 record load designed_coefficients experiments/doe/coefficients_record.json
Failed to post to /ensembles/30dc4234-ce64-416b-a5fa-4691d1a7c9be/records/designed_coefficients/matrix?realization_index=0. Response: {"detail":{"realization_index":"0","ensemble_id":"30dc4234-ce64-416b-a5fa-4691d1a7c9be","name":"designed_coefficients","error":"Ensemble-wide record 'designed_coefficients' for ensemble '30dc4234-ce64-416b-a5fa-4691d1a7c9be' already exists"}}
{"detail":{"realization_index":"0","ensemble_id":"30dc4234-ce64-416b-a5fa-4691d1a7c9be","name":"designed_coefficients","error":"Ensemble-wide record 'designed_coefficients' for ensemble '30dc4234-ce64-416b-a5fa-4691d1a7c9be' already exists"}}

(the double output of response is as observed in terminal)

Expected behavior
Be able to in some sort properly get data into ert and continue my work

Enviromment

  • ert version 2.30.0b2.dev194+g5770c2926
  • OS: [e.g. osx]
  • Python version: 3.6
@verveerpj
Copy link
Contributor

The source of the problem is that ensemble-wide records are currently stored in a "special" global ensemble. Cleaning that would require deleting that ensemble in ert storage. This is currently not supported and would have to added to ert-storage That may be possible, but I am not quite sure how far-reaching the consequences would be.

Together with Jonas and Julius, we discussed this, and noted that ert storage may not match well with what we try to do in ert3, leading to such hacks as a special ensemble to store ensemble-wide records. We concluded that we should look into improving ert storage to resolve these and related issues. I would therefore suggest that we do not add new functionality to ert-storage just to resolve this bug, but rather wait until ert-storage solidifies.

Therefore, it may be better to postpone resolving this bug until we have done that.

@sondreso
Copy link
Collaborator

I agree! Added this issue to the list of related issue for the storage discrepancy milestone (#2707)

@eivindjahren
Copy link
Contributor

Closing as related to ert3, which is no longer the direction taken by the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants