ert icon indicating copy to clipboard operation
ert copied to clipboard

Uninformative error message in terminal when trying to open webviz ert with incompatible storage

Open larsevj opened this issue 10 months ago • 1 comments

Describe the bug If you try to open webviz-ert with an experiment that was made with an older incompatible storage, e.g. created experiment with 2024.02 and try to run webviz-ert with 2024.04, then you will get the following Error printed to the terminal.

ERROR:root:Error fetching data from http://127.0.0.1:51827/experiments
                The request return with status code: 500
                b'Traceback (most recent call last):\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/middleware/errors.py", line 164, in __call__\n    await self.app(scope, receive, _send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/middleware/exceptions.py", line 62, in __call__\n    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app\n    raise exc\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app\n    await app(scope, receive, sender)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 758, in __call__\n    await self.middleware_stack(scope, receive, send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 778, in app\n    await route.handle(scope, receive, send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 299, in handle\n    await self.app(scope, receive, send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 79, in app\n    await wrap_app_handling_exceptions(app, request)(scope, receive, send)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app\n    raise exc\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app\n    await app(scope, receive, sender)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 74, in app\n    response = await func(request)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/fastapi/routing.py", line 269, in app\n    solved_result = await solve_dependencies(\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/fastapi/dependencies/utils.py", line 600, in solve_dependencies\n    solved = await run_in_threadpool(call, **sub_values)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool\n    return await anyio.to_thread.run_sync(func, *args)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/to_thread.py", line 56, in run_sync\n    return await get_async_backend().run_sync_in_worker_thread(\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread\n    return await future\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/_backends/_asyncio.py", line 851, in run\n    result = context.run(func, *args)\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/dark_storage/enkf.py", line 22, in get_storage\n    return (_storage := open_storage(os.environ["ERT_STORAGE_ENS_PATH"]))\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/storage/__init__.py", line 34, in open_storage\n    return LocalStorage(Path(path), Mode(mode))\n  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/storage/local_storage.py", line 85, in __init__\n    raise RuntimeError(\nRuntimeError: Cannot open storage \'/private/levje/ert/test-data/poly_example/storage\' in read-only mode: Storage version 4 is too old\n'
                
2024-04-11 14:58:27,552 [ERROR] uvicorn.error: Exception in ASGI application
Traceback (most recent call last):
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 412, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 758, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 778, in app
    await route.handle(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 299, in handle
    await self.app(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 79, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/routing.py", line 74, in app
    response = await func(request)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/fastapi/routing.py", line 269, in app
    solved_result = await solve_dependencies(
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/fastapi/dependencies/utils.py", line 600, in solve_dependencies
    solved = await run_in_threadpool(call, **sub_values)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/dark_storage/enkf.py", line 22, in get_storage
    return (_storage := open_storage(os.environ["ERT_STORAGE_ENS_PATH"]))
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/storage/__init__.py", line 34, in open_storage
    return LocalStorage(Path(path), Mode(mode))
  File "/prog/res/komodo/2024.04.rc0-py38-rhel7/root/lib64/python3.8/site-packages/ert/storage/local_storage.py", line 85, in __init__
    raise RuntimeError(
RuntimeError: Cannot open storage '/private/levje/ert/test-data/poly_example/storage' in read-only mode: Storage version 4 is too old

Expected behaviour Should not get the full stack trace, and instead get the solution to the Error which is to open ert so that storage migration happens.

Environment

  • OS: [e.g. RHEL7]
  • ERT/Komodo release: [e.g. 2.18 or 2020.12.00]
  • Python version
  • Remote/HPC execution involved: [yes|no]

Additional context Add any other context about the problem here.

larsevj avatar Apr 11 '24 14:04 larsevj

I think this relates to #7630

andreas-el avatar Apr 12 '24 06:04 andreas-el