failing unregistration lead to crashes in several addons #51547

Closed
opened 2017-05-18 18:03:09 +02:00 by mathieu menuet · 25 comments

System Information
all

Blender Version
Broken: latest master

Short description of error
Those addons don't properly unregister everything, leading to crashes and possibly user pref/keymap corruption:
NPStation (solved)
archipack (solved)
add mesh: castle
measure panel (solved)
dynamic context menu (in interaction with other addons)
layer management (solved)
animated text
kjartan's script (solved)
autotracker (in interaction with other addons)
creaprim

Exact steps for others to reproduce the error
activate and then deactivate one of this addon. If you save userpref after it, your user preferences may be corrupted. Only deleting it works then.

**System Information** all **Blender Version** Broken: latest master **Short description of error** Those addons don't properly unregister everything, leading to crashes and possibly user pref/keymap corruption: NPStation (solved) archipack (solved) add mesh: castle measure panel (solved) dynamic context menu (in interaction with other addons) layer management (solved) animated text kjartan's script (solved) autotracker (in interaction with other addons) creaprim **Exact steps for others to reproduce the error** activate and then deactivate one of this addon. If you save userpref after it, your user preferences may be corrupted. Only deleting it works then.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @bliblubli

Added subscriber: @bliblubli
Author

Added subscribers: @Okavango, @BrendonMurphy, @VukGardasevic
Removed subscriber: @bliblubli

Added subscribers: @Okavango, @BrendonMurphy, @VukGardasevic Removed subscriber: @bliblubli
Member

Added subscriber: @bliblubli

Added subscriber: @bliblubli
Member

hi, will look, can we have some more information?
lijenstina has been working on reg issues, although i'm not finding any issue with dynamic context menu.
@bliblubli are you talking about search for unknown operator on unreg?

hi, will look, can we have some more information? lijenstina has been working on reg issues, although i'm not finding any issue with dynamic context menu. @bliblubli are you talking about search for unknown operator on unreg?
Author

I'm speaking about addons that don't support to be reloaded. The new template system allows to have different addons activated depending on the startup file chosen. It sometime lead to reloading addons (like F8) and crashes when those don't correctly reload.

I'm speaking about addons that don't support to be reloaded. The new template system allows to have different addons activated depending on the startup file chosen. It sometime lead to reloading addons (like F8) and crashes when those don't correctly reload.

Hi @bliblubli, can't reproduce the problem, what kind of console error do you get?

Hi @bliblubli, can't reproduce the problem, what kind of console error do you get?
Author

Hi @Okavango , can't reproduce either in latest build, I must have had an old build somewhere. Updated task.

Hi @Okavango , can't reproduce either in latest build, I must have had an old build somewhere. Updated task.
Author

I tested the other ones again to see if the new build solve the other problems:
measure panel support F8 now as long is it was not activated, otherwise, creating a new file or reloading give this error:

Traceback (most recent call last):
  File "C:\bl\blender-2.78.0-git.3bf69b2-windows64\2.78\scripts\addons_contrib\space_view3d_panel_measure.py", line 948, in cancel
    display_measurements.handle_remove(context)
NameError: name 'display_measurements' is not defined
I tested the other ones again to see if the new build solve the other problems: measure panel support F8 now as long is it was not activated, otherwise, creating a new file or reloading give this error: ``` Traceback (most recent call last): File "C:\bl\blender-2.78.0-git.3bf69b2-windows64\2.78\scripts\addons_contrib\space_view3d_panel_measure.py", line 948, in cancel display_measurements.handle_remove(context) NameError: name 'display_measurements' is not defined ```
Author

@BrendonMurphy creaprime, castle and animated text stil have reloading problems, other are solved :)

@BrendonMurphy creaprime, castle and animated text stil have reloading problems, other are solved :)

@bliblubli
I'll look at the problem next week after some remaining fixes for the release add-ons. By bcon4 this will be addressed :)

@bliblubli I'll look at the problem next week after some remaining fixes for the release add-ons. By bcon4 this will be addressed :)
Member

hi, thanks for heads up & fixes

hi, thanks for heads up & fixes
Author

ok, tested a little bit more. Some errors only show up when other addons are activated. An easy way to see it is to activate all addons and press F8, then you get the errors form castle, creaprime and animated text plus this:

Read prefs: C:\Users\test\AppData\Roaming\Blender Foundation\Blender\2.78\config\userpref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 192000hz instead
found bundled python: C:\blender-2.78.0-git.102394a-windows64\2.78\python
archipack: ready
measureit: Imported multifiles
archimesh: Imported multifiles
Rock generator settings file found:
C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons_contrib\add_mesh_rocks\add_mesh_rocks.xml
Rock Generator: Numpy found.
Text is not a valid section.
Text is not a valid section.
------------------------------
Exact Offsets loaded
quickprefs: loading default presets
adding default presets
Exception in module unregister(): 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\addons\\space_view3d_spacebar_menu.py'
Traceback (most recent call last):
  File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\modules\addon_utils.py", line 398, in disable
    mod.unregister()
  File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons\space_view3d_spacebar_menu.py", line 3090, in unregister
    bpy.utils.unregister_class(cls)
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'OrderedMeta' instance (may not be registered)
Exception in module unregister(): 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\addons\\space_clip_editor_autotracker.py'
Traceback (most recent call last):
  File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\modules\addon_utils.py", line 398, in disable
    mod.unregister()
  File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons\space_clip_editor_autotracker.py", line 342, in unregister
    bpy.utils.unregister_class(AutotrackerOperator)
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'OrderedMeta' instance (may not be registered)
addon_utils.disable: add_mesh_extra_objects not loaded.
Reloading: <module 'bl_operators' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\bl_operators\\__init__.py'>
Reloading: <module 'bl_ui' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\bl_ui\\__init__.py'>
Reloading: <module 'keyingsets_builtins' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\keyingsets_builtins.py'>
Reloading: <module 'nodeitems_builtins' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\nodeitems_builtins.py'>
archimesh: Reloaded multifiles
------------------------------
measureit: Reloaded multifiles
tinyCAD: detected reload event.
tinyCAD: reloaded modules, all systems operational
archipack: reload ready
Rock Generator: Numpy found.
Exact Offsets loaded
<bpy_struct, KeyMapItem("text.autocomplete")> key exists
<bpy_struct, KeyMapItem("text.line_break")> key exists
gc.collect() -> 9487

So autotracker and dynamic menu also have reload problem under some circumstances.

There are no traceback for erta mesh but this line:

addon_utils.disable: add_mesh_extra_objects not loaded.

Full log is here if you want: http://pasteall.org/407502

ok, tested a little bit more. Some errors only show up when other addons are activated. An easy way to see it is to activate all addons and press F8, then you get the errors form castle, creaprime and animated text plus this: ``` Read prefs: C:\Users\test\AppData\Roaming\Blender Foundation\Blender\2.78\config\userpref.blend AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 192000hz instead found bundled python: C:\blender-2.78.0-git.102394a-windows64\2.78\python archipack: ready measureit: Imported multifiles archimesh: Imported multifiles Rock generator settings file found: C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons_contrib\add_mesh_rocks\add_mesh_rocks.xml Rock Generator: Numpy found. Text is not a valid section. Text is not a valid section. ------------------------------ Exact Offsets loaded quickprefs: loading default presets adding default presets Exception in module unregister(): 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\addons\\space_view3d_spacebar_menu.py' Traceback (most recent call last): File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\modules\addon_utils.py", line 398, in disable mod.unregister() File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons\space_view3d_spacebar_menu.py", line 3090, in unregister bpy.utils.unregister_class(cls) RuntimeError: unregister_class(...):, missing bl_rna attribute from 'OrderedMeta' instance (may not be registered) Exception in module unregister(): 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\addons\\space_clip_editor_autotracker.py' Traceback (most recent call last): File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\modules\addon_utils.py", line 398, in disable mod.unregister() File "C:\blender-2.78.0-git.102394a-windows64\2.78\scripts\addons\space_clip_editor_autotracker.py", line 342, in unregister bpy.utils.unregister_class(AutotrackerOperator) RuntimeError: unregister_class(...):, missing bl_rna attribute from 'OrderedMeta' instance (may not be registered) addon_utils.disable: add_mesh_extra_objects not loaded. Reloading: <module 'bl_operators' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\bl_operators\\__init__.py'> Reloading: <module 'bl_ui' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\bl_ui\\__init__.py'> Reloading: <module 'keyingsets_builtins' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\keyingsets_builtins.py'> Reloading: <module 'nodeitems_builtins' from 'C:\\blender-2.78.0-git.102394a-windows64\\2.78\\scripts\\startup\\nodeitems_builtins.py'> archimesh: Reloaded multifiles ------------------------------ measureit: Reloaded multifiles tinyCAD: detected reload event. tinyCAD: reloaded modules, all systems operational archipack: reload ready Rock Generator: Numpy found. Exact Offsets loaded <bpy_struct, KeyMapItem("text.autocomplete")> key exists <bpy_struct, KeyMapItem("text.line_break")> key exists gc.collect() -> 9487 ``` So autotracker and dynamic menu also have reload problem under some circumstances. There are no traceback for erta mesh but this line: ``` addon_utils.disable: add_mesh_extra_objects not loaded. ``` Full log is here if you want: http://pasteall.org/407502

Added subscriber: @Sergey

Added subscriber: @Sergey

Is anyone actually solving these problems?

Is anyone actually solving these problems?

Added subscriber: @MauriceRaybaud

Added subscriber: @MauriceRaybaud

Note - the warning:

addon_utils.disable: add_mesh_extra_objects not loaded.

comes from here , as the PovRay add-on enables/disables Mesh Extra Objects.
@MauriceRaybaud could the wm.addon_userpref_show operator be used instead similarly to the CrackIt add-on?

Note - the warning: > addon_utils.disable: add_mesh_extra_objects not loaded. comes from [here ](https://developer.blender.org/diffusion/BA/browse/master/render_povray/__init__.py;856c1b92841d552cd763b678d75f74c214bdb963$2180), as the PovRay add-on enables/disables Mesh Extra Objects. @MauriceRaybaud could the `wm.addon_userpref_show` operator be used instead similarly to the CrackIt add-on?

Done. Thanks

In #51547#440717, @VukGardasevic wrote:
Note - the warning:

addon_utils.disable: add_mesh_extra_objects not loaded.

comes from here , as the PovRay add-on enables/disables Mesh Extra Objects.
@MauriceRaybaud could the wm.addon_userpref_show operator be used instead similarly to the CrackIt add-on?

Done. Thanks > In #51547#440717, @VukGardasevic wrote: > Note - the warning: > >> addon_utils.disable: add_mesh_extra_objects not loaded. > > comes from [here ](https://developer.blender.org/diffusion/BA/browse/master/render_povray/__init__.py;856c1b92841d552cd763b678d75f74c214bdb963$2180), as the PovRay add-on enables/disables Mesh Extra Objects. > @MauriceRaybaud could the `wm.addon_userpref_show` operator be used instead similarly to the CrackIt add-on?

Thanks for the fix:)

Thanks for the fix:)

@bliblubli
If you have time, can you please test if now there are more problems with the register / unregister / reload all add-ons?
Thanks in advance :)

@bliblubli If you have time, can you please test if now there are more problems with the register / unregister / reload all add-ons? Thanks in advance :)

Note:
Currently the add-on object_facemap_auto is importing some of the 2.8 API functionality (ManipulatorGroup) so it'll fail to register with 2.7x series. Disregard it for now since it'll not be included in the 2.79 release.

> **Note**: > Currently the add-on `object_facemap_auto` is importing some of the 2.8 API functionality (ManipulatorGroup) so it'll fail to register with 2.7x series. Disregard it for now since it'll not be included in the 2.79 release.
Member

hi, is this resolved for 2.79 release?

hi, is this resolved for 2.79 release?

I think it is safe to close. Maybe waiting for a day or two after RC 2 release. :)

I think it is safe to close. Maybe waiting for a day or two after RC 2 release. :)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Vuk Gardašević self-assigned this 2017-09-20 23:33:02 +02:00

Well since 2.79 is released, we can close this.

For the current possible problems with master we can use #52564 instead.

Well since 2.79 is released, we can close this. For the current possible problems with master we can use #52564 instead.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#51547
No description provided.