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

[Iteration enhancement] RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted #223

Closed
servoz opened this issue Aug 19, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@servoz
Copy link
Contributor

servoz commented Aug 19, 2021

As already observed earlier, we sometimes see exceptions being raised during initialisation in iteration modes. It seemed to be erratic so I was hesitating to open a ticket about it as it is difficult to give a minimum procedure to reproduce an erratic problem. But I've seen this issue several times while working on iteration and it's really annoying. I'm trying here a minimal procedure to reproduce, knowing that I haven't yet succeeded in finding the exact cause ...:

  • From a database with Exp Type and PatientName tags as described in the iteration documentation.
  • Add the mia_processes > bricks > preprocess > spm > Smooth process/brick to the pipeline editor.
  • Check on the iterate pipeline button.
    • A dialog pops up and displays all the pipeline parameters. Check all parameters for the iter. section and the in_files for the database section:
      Selection_067
  • Then click on the OK button. The process/brick will now be changed into an iterative pipeline, with an iterative node, and one Input_Filters bricks/processes (in_files_filter node). The former Smooth process/brick is now inside the iterative node:
    Selection_068
  • Right-click on the in_files_filter node, and select “Open filter”. In the filter pop-up, modify the filter to apply to select all anatomical images (“Exp Type == anat”), then click on the OK button:
    Selection_069
  • In the iteration section (top right of the pipeline manager tab), click on the “iterate over” feature (“Select” button). A dialog pops up and displays all the tags in the current project. Check the tag on which the pipeline will be iterated, the “PatientName” tag, then click on the OK button.
  • Change the values used for the iteration by clicking on the Filter button. We only want to iterate on the “alej” and “rocmi” patients, so we check these parameters:
    Selection_070
  • Click on “Initialize pipeline”. The Run pipeline button becomes enabled, BUT:
    • The status bar display: Pipeline "NoName" was not initialised successfully.
    • The stdout display:
- Pipeline initialising ...

Completion ...

. Iteration_pipeline.in_files_filter (mia_processes.bricks.tools.tools.Input_Filter) MIA node ...

During the <mia_processes.bricks.tools.tools.Input_Filter object at 0x7f930f29f360> process initialisation, some possible problems were detected:
- inheritance_dict attribute was not found ...

Exception occurred in traits notification handler for object: <populse_mia.user_interface.pipeline_manager.process_mia.MIAProcessCompletionEngine object at 0x7f930fc42ca8>, trait: completion_progress, old value: 0.0, new value: 1.0
Traceback (most recent call last):
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event
    self.dispatch(handler, *args)
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch
    handler(*args)
  File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed
    if not hasattr(self, 'progressdialog'):
RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted

. main (mia_processes.bricks.preprocess.spm.spatial_preprocessing.Smooth) MIA node ...

. main (mia_processes.bricks.preprocess.spm.spatial_preprocessing.Smooth) MIA node ...
Exception occurred in traits notification handler for object: <populse_mia.user_interface.pipeline_manager.process_mia.MIAProcessCompletionEngine object at 0x7f930f451b48>, trait: completion_progress, old value: 0.0, new value: 2.05
Traceback (most recent call last):
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event
    self.dispatch(handler, *args)
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch
    handler(*args)
  File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed
    if not hasattr(self, 'progressdialog'):
RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted

Error during initialisation of the "NoName" pipeline ...!
Traceback:
  File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 1206, in initialize
    self.test_init = self.init_pipeline()
  File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 1270, in init_pipeline
    self.complete_pipeline_parameters(pipeline)
  File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 983, in complete_pipeline_parameters
    completion.complete_parameters()
  File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/process_mia.py", line 310, in complete_parameters
    self.completion_progress = self.fallback_engine.completion_progress
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 478, in __call__
    self.notify_listener(self, object, trait_name, old, new)
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 553, in _notify_method_listener
    object, trait_name, old, new, listener
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 532, in _dispatch_change_event
    handle_exception(object, trait_name, old, new)
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 149, in _handle_exception
    raise excp
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event
    self.dispatch(handler, *args)
  File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch
    handler(*args)
  File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed
    if not hasattr(self, 'progressdialog'):
RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted
  • In Data Browser we observe that no indexing has been done during the initialisation.
  • Because the Run pipeline button is enabled, click on this (careful! if we go to another tab after the initialisation, by going to the Data Browser or another editor of the Pipeline Manager and returning to the previous editor of the Pipeline Manager, the Run Pipeline button is no longer available!) :
    • The run step goes smoothly, the expected data are found in the derived_data directory. Of course, this is an run that did not produce any indexing of the database (so it's not just an issue with an exception being thrown that has no impact!)

Note: after several tries, i managed to reproduce the bug by following this procedure and then clicking on the in_files_filter node before clicking on the initialise button .... it seems like a voodoo incantation...

@servoz servoz added the bug Something isn't working label Aug 19, 2021
@servoz
Copy link
Contributor Author

servoz commented Aug 23, 2021

@LStruber LStruber self-assigned this Nov 9, 2021
@servoz servoz assigned servoz and unassigned LStruber Nov 12, 2021
@servoz servoz closed this as completed in e13d399 Nov 12, 2021
servoz added a commit that referenced this issue Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants