RAFCON icon indicating copy to clipboard operation
RAFCON copied to clipboard

strange error while loading state machine

Open franzlst opened this issue 4 years ago • 3 comments

Error while loading state data: Data file not found: /home_local/sebastian-brunner/robust_efficient_robot_tasks/pick_object/pick_object_HFXWXK/meta.json Traceback (most recent call last): File "/internal_path/common/packages/rafcon/0.12.0/source/rafcon/core/storage/storage.py", line 402, in load_state_recursively state_info = load_data_file(path_core_data) File "/internal_path/common/packages/rafcon/0.12.0/source/rafcon/core/storage/storage.py", line 483, in load_data_file raise ValueError("Data file not found: {0}".format(path_of_file)) ValueError: Data file not found: /home_local/sebastian-brunner/robust_efficient_robot_tasks/pick_object/pick_object_HFXWXK/meta.json 10:03:11 ERROR - gui.helpers.state_machine: Error while trying to open state machine: 'NoneType' object has no attribute 'get_states_statistics'

Originally created by @sebastian-brunner ([email protected]) at 2017-11-23 09:08:47+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

Rafcon says it cannot find a meta.json, but rafcon should create one if it does not exist!?

Originally created by @sebastian-brunner ([email protected]) at 2017-11-23 09:09:26+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

The problem was actually that, Andi did not pushed a state machine correctly (so now the state machine runs), but still this error is misleading/strange.

Originally created by @sebastian-brunner ([email protected]) at 2017-11-23 09:10:43+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

The issue for the misleading error message is line 358 of storage.py: state_machine.root_state = load_state_recursively(parent=state_machine, state_path=root_state_path)

The root state is directly asserted, without checking the return value of load_state_recursively. This is None, if the data file is not found. The exception for the missing data file is caught in load_state_recursively (line 403) and None is returned instead of a state.

So either the return value should be checked or the exception caught somewhere else.

Originally created by @franzlst ([email protected]) at 2017-11-23 11:52:38+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst