Bug report #19607

Deactivating/uninstalling plugin causes Python error when trying to edit a Processing model

Added by Magnus Nilsson about 2 years ago. Updated over 1 year ago.

Affected QGIS version:3.2.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27434


When I do these steps, I get a Pythin error:

1) Install a new plugin, such as QNEAT3
2) Create a simple processing model that uses this plugin
3) Deativate/uninstall the plugin
4) Try to edit the model

I don´t expect the model to run when the plugin is missing, but I would still like to be able to open and edit it. Perhaps QGIS, in the model window, could simply remove the plugin and give a hint to the user about the missing plugin? When I reactivate/install the plugin in again, I can edit the model.

The log:

Ett fel har inträffat vid Pythonexekvering:

AttributeError: 'NoneType' object has no attribute 'svgIconPath'
Traceback (most recent call last):
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\EditModelAction.py", line 44, in execute
dlg = ModelerDialog(alg)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 403, in init
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 661, in repaintModel
self.scene.paintModel(self.model, controls)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerScene.py", line 120, in paintModel
item = ModelerGraphicItem(alg, model, controls, scene=self)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerGraphicItem.py", line 78, in init
if element.algorithm().svgIconPath():
AttributeError: 'NoneType' object has no attribute 'svgIconPath'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version: 3.2.1-Bonn Bonn, 1edf372fb8

Python sökväg:
C:\Program Files\QGIS 3.2\bin\python36.zip
C:\Program Files\QGIS 3.2\bin

Associated revisions

Revision a86965e9
Added by Victor Olaya over 1 year ago

[processing] do not allow editing model if it's missing algorithms

fixes #19607


#1 Updated by Alexander Bruy about 2 years ago

  • Status changed from Open to Feedback
  • Operating System deleted (Windows 10 64 bit)

This is expected and correct behaviour. If plugin with 3rd party algorithms is not installed/desctivated, its algorithms also not available in the Processing. As result Processing simply don't know which inputs and outputs algorithm has and can't instantiate algorithm itself.

But it should not show traceback, a message warning user about missing algorithms should be shown instead and editing should be disbaled for such models.

#2 Updated by Magnus Nilsson about 2 years ago

I possible, I think QGIS should list the missing plugins used in the model and give the user a chance to install them and edit/run the model.

#3 Updated by Giovanni Manghi about 2 years ago

But it should not show traceback, a message warning user about missing algorithms should be shown instead and editing should be disbaled for such models.

moving to feature request?

#4 Updated by Olivier Dalang almost 2 years ago

This happens too with user defined models.

If a parent model contains a child model, and a some point, the child model is removed, the parent model can't be edited anymore.

I think this should be considered a bug rather than a feature request, as it makes it very easy to destroy models in which users may have put a lot of work.

#5 Updated by Victor Olaya over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF