Skip to content

"boost::bad_get: failed value get using boost::get" error when using UDA with certain options #97

@olivhoenen

Description

@olivhoenen

This is related to iterorganization/IMAS-Core#22 opened by @paulotex on IMAS-Core.

Trying to reproduce and understand the issue, I get the feeling (but no real evidence yet) that this issue may be due to an interplay between imas-python and the UDA backend in the core.

Snippet to reproduce the error, using IMAS-Python 2.1.0 (but I also checked with develop) and IMAS-Core 5.5.2:

import imas
dbentry = imas.DBEntry("imas://uda.iter.org:56565/uda?path=/work/imas/shared/imasdb/ITER/3/121013/50&backend=hdf5&verbose=1", "r")
cp = in_dbentry.get("core_profiles", autoconvert=False) 
print(f"Read time array: {cp.time.value}")

Traceback:

  File "/work/imas/opt/EasyBuild/software/IMAS-Python/2.1.0-intel-2023b/lib/python3.11/site-packages/imas/backends/imas_core/al_context.py", line 149, in read_data
    status, data = ll_interface.read_data(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "_al_lowlevel.pyx", line 998, in imas_core._al_lowlevel.al_read_data
  File "_al_lowlevel.pyx", line 849, in imas_core._al_lowlevel.al_read_data_scalar
imas_core.exception.ALException: Error while reading data: al_plugin_read_data: boost::bad_get: failed value get using boost::get
Error status=-1

Note that the get operation with direct read using the hdf5 backend works as expected.

Now if I force dd_version="3.38.1" (corresponds to the version of the pulse) when opening the DBentry, I don't see the error (with or without autoconvert=False in the get). In fact all later DD3 versions work, but not DD4.

If I use lazy=True (with or without adding cache_mode=None in the URI) it also works as expected.

Now if I disable the cache and use a normal (non-lazy) get, I may be facing the same error but the reported message is different and may be more insightful:

  File "/home/ITER/hoeneno/GIT/IMAS-Python/venv/lib/python3.11/site-packages/imas/backends/imas_core/al_context.py", line 149, in read_data
    status, data = ll_interface.read_data(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "_al_lowlevel.pyx", line 992, in imas_core._al_lowlevel.al_read_data
  File "_al_lowlevel.pyx", line 975, in imas_core._al_lowlevel.al_read_data_string
imas_core.exception.ALException: Error while reading data: al_plugin_read_data: cannot find node core_profiles/ids_properties/source in data dictionary (source not found)

Any idea @maarten-ic @prasad-sawantdesai ?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions