Error "remove unused items"

Hi, performing checks and selecting “remove unused items”, I am returned this error

227001: ERROR: tool.py: line 257: Failed to start tool.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/tool.py", line 251, in gui_tool
    tool_class(dbstate = dbstate, user = user,
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 127, in __init__
    self.init_gui()
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 175, in init_gui
    self.sort_model = self.real_model.sort_new_with_model()
AttributeError: 'ListStore' object has no attribute 'sort_new_with_model'

Gramp 5.1 on Linux Mint Una

Error Details:

227001: ERROR: tool.py: line 257: Failed to start tool.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/tool.py", line 251, in gui_tool
    tool_class(dbstate = dbstate, user = user,
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 127, in __init__
    self.init_gui()
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 175, in init_gui
    self.sort_model = self.real_model.sort_new_with_model()
AttributeError: 'ListStore' object has no attribute 'sort_new_with_model'
410582: ERROR: tool.py: line 257: Failed to start tool.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/tool.py", line 251, in gui_tool
    tool_class(dbstate = dbstate, user = user,
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 127, in __init__
    self.init_gui()
  File "/usr/lib/python3/dist-packages/gramps/plugins/tool/removeunused.py", line 175, in init_gui
    self.sort_model = self.real_model.sort_new_with_model()
AttributeError: 'ListStore' object has no attribute 'sort_new_with_model'

System Information:

Gramps version: 5.1.2
Python version: 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
BSDDB version: 6.2.7 (5, 3, 28)
sqlite version: 3.31.1 (2.6.0)
LANG: it_IT.UTF-8
OS: Linux
Distribution: 5.4.0-96-generic

GTK version : 3.24.20
gobject version: 3.36.0
cairo version : (1, 16, 2)

Hi, that error was fixed in Gramps 5.1.3 see:

When Gramps 5.1.5 is released in the next week or so, back up and then upgrade.

Excuse my ignorance but, having installed 5.1 from the distribution’s application manager, how can I upgrade without causing further damage?
Thank you

With the installation of the new release the problems have been solved but now there is an export problem that returns this message
WARNING .Db: database is closed

Problems upon problems! I tried to install the current release but, at the first export in gedcom, it completely empties the database. Fortunately I have a recent backup but the same problem also occurs with the flatpak version of the package. Despair!

That’s a bit of excessive error reporting for a normal state when Gramps starts.

When the GUI initializes, there will be no database loaded. (Even if you have Preferences set to reload the last Tree upon restart, it sets up the GUI 1st.) Some of the Gramplets & Views don’t handle this state gracefully and mis-report it as an error.

@SNoiraud has rerouted the “database is closed” error message for the future releases of Gramps. But it is considered an Enhancement rather than a bug. So it will be rolled in 5.2 months in the future, not in the imminent bugfix 5.1.5 version.

However, when 5.1.5 is released and you install it, you can apply that patch manually.

[Cannot reproduce with 5.1.4 Windows]

Wow! That’s a BIG one! Maybe there’s still time to find that before 5.1.5 is finalized?

I could not reproduce the Tree being emptied while exporting the example.gramps sample tree in the 5.1.4 Windows version.

Could you try with an import of that into a new tree and see if the problem recurs? (Please take a snapshot after clicking the Calculate Previews of the Export filters and post that. It is too hard to describe those settings accurately.)

Were you using the GEDCOM or GEDCOM extensions (GED2) option in the 2nd “Choose the output format” step?

I don’t know what happened but for the moment the problem seems to be solved. I generally export in .ged and often using GedcomforGeneanet. However, with the flatpak version, apart from closing the database, it seems to work. Thank you.

OK. Closing the database is different from emptying it.

@SNoiraud You addressed a similar issue in what the proposed 1st Time User enhancement did when importing your sample data. Could you snoop around the GEDCOM export and see if it needs the same fix?

@PLegoux could you make GlopGlop on Geneanet aware of the similar problem Serge fixed and ask him to review his GEDCOMforGeneanet add-on?

1 Like

It is true. But this morning, in the first attempts, the database was actually emptied and I had to recover it from backup :frowning:

Do you recall which export you were using? (The GEDCOM created at that time will have a datasource listed in the 1st few lines. That identifies the export method.)

i was exporting to standard gedcom

1 Like

Done

1 Like

Hi

I would like to review my addon
but i haven"t really seen where is the problem.

and i m not really sure it was related to gedcom export.

I didn’t see the relation between the fix of @Snoiraud and the problem here.

@maudel can u test export your database in xml to see if you have also the problem. The result will help us to narrow the problem.

1 Like

In truth I have complained about problems with the 5.1 release of Gramps which, in the case of using the “remove unused objects” tool, gave me an error in Python and, in the case of export, both in standard gedcom and in the case of gedcom intended for Geneanet , I closed the database. In some cases it also emptied it and I had to reuse the backup.
Having then installed version 5.1.4 Flatpak the problem no longer arose. Exported Gedcom for Geneanet this morning without detecting problems.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.