Bug report #19933

python error in DB Manager while trying to preview a layer and empty preview

Added by Giovanni Manghi about 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:3.7(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27756

Description

I'm not sure what is triggering this, but at times a preview of a layer won't work in db manager, and if the focus is moved to the "info" tab the following error will pop up:

Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/db_manager/db_manager.py", line 117, in tabChanged
self.refreshTabs()
File "/usr/share/qgis/python/plugins/db_manager/db_manager.py", line 140, in refreshTabs
self.preview.loadPreview(item)
File "/usr/share/qgis/python/plugins/db_manager/layer_preview.py", line 62, in loadPreview
self._clear()
File "/usr/share/qgis/python/plugins/db_manager/layer_preview.py", line 89, in _clear
self._loadTablePreview(None)
File "/usr/share/qgis/python/plugins/db_manager/layer_preview.py", line 121, in _loadTablePreview
if self.currentLayer:
RuntimeError: wrapped C/C++ object of type QgsVectorLayer has been deleted

Associated revisions

History

#1 Updated by Alessandro Pasotti about 6 years ago

  • Status changed from Open to Feedback

Works for me on current linux/master.

I understand that it is kind of random but you should try to find the way to reproduce it or I don't see a chance for finding a solution.

#2 Updated by Giovanni Manghi about 6 years ago

I understand that it is kind of random but you should try to find the way to reproduce it or I don't see a chance for finding a solution.

I understand that, until now a clear way to replicate always eluded me.

#3 Updated by Jürgen Fischer almost 6 years ago

  • Status changed from Feedback to Closed
  • Resolution set to no timely feedback

Bulk closing 82 tickets in feedback state for more than 90 days affecting an old version. Feel free to reopen if it still applies to a current version and you have more information that clarify the issue.

#4 Updated by Giovanni Manghi almost 6 years ago

  • Resolution deleted (no timely feedback)
  • Affected QGIS version changed from 3.3(master) to 3.7(master)
  • Status changed from Closed to Open

Just tested with master, the error changed but is still reproducable by opening a schema, selecting layers and swithcing tabs (preview, table, info):

AttributeError: 'NoneType' object has no attribute 'id'
Traceback (most recent call last):
File "/usr/local/share/qgis/python/plugins/db_manager/db_manager.py", line 119, in tabChanged
self.refreshTabs()
File "/usr/local/share/qgis/python/plugins/db_manager/db_manager.py", line 142, in refreshTabs
self.preview.loadPreview(item)
File "/usr/local/share/qgis/python/plugins/db_manager/layer_preview.py", line 62, in loadPreview
self._clear()
File "/usr/local/share/qgis/python/plugins/db_manager/layer_preview.py", line 89, in _clear
self._loadTablePreview(None)
File "/usr/local/share/qgis/python/plugins/db_manager/layer_preview.py", line 132, in _loadTablePreview
self.currentLayerId = vl.id()
AttributeError: 'NoneType' object has no attribute 'id'

#5 Updated by Giovanni Manghi almost 6 years ago

  • Subject changed from python error in DB Manager while trying to preview a layer to python error in DB Manager while trying to preview a layer and empty preview
  • Regression? changed from No to Yes
  • Priority changed from Normal to High

actually I just noticed that on master (linux here) the preview is blank and that I triggered the above error by selecting another connection after having opened the preview panel for a layer.

#6 Updated by Jürgen Fischer almost 6 years ago

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

#7 Updated by Jürgen Fischer almost 6 years ago

  • Priority changed from High to Normal

Giovanni Manghi wrote:

actually I just noticed that on master (linux here) the preview is blank and that I triggered the above error by selecting another connection after having opened the preview panel for a layer.

BTW are you getting instant notifications now?

#8 Updated by Giovanni Manghi almost 6 years ago

BTW are you getting instant notifications now?

it seems so, thanks!

#9 Updated by Giovanni Manghi almost 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF