Snap Gramps Graphview/fedora42 error

I was experimenting with the snap version of Gramps 6.03 today and got all the way to the point where I was addressing the pre-requisites for add-ons to get it up and running when this error was thrown. I have never seen this particular unhandled exception error before and since it comes from the first snap I have tried on Fedora42 I thought it might interest the community.

  1. I uninstalled the gramps 6.0.1 (default) for Fedora 42
  2. installed snapd
  3. installed the 6.0.3 snap version of Gramps and all seemed good.
  4. as it is strictly confined I re-mapped all the directories I need..backups, media, etc to mount point in my personal folder and again good so far.
  5. began adding pre-requisites and when I got to Graphview this cam up.
57961: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "/snap/gramps/4/lib/python3.12/site-packages/gramps/gui/viewmanager.py", line 968, in view_changed
    self.__change_page(page_num)
  File "/snap/gramps/4/lib/python3.12/site-packages/gramps/gui/viewmanager.py", line 984, in __change_page
    self.active_page.set_active()
  File "/snap/gramps/4/lib/python3.12/site-packages/gramps/gui/views/navigationview.py", line 151, in set_active
    PageView.set_active(self)
  File "/snap/gramps/4/lib/python3.12/site-packages/gramps/gui/views/pageview.py", line 373, in set_active
    self.build_tree()
  File "/home/brian/snap/gramps/4/.local/share/gramps/gramps60/plugins/GraphView/graphview.py", line 299, in build_tree
    self.graph_widget.populate(self.get_active())
  File "/home/brian/snap/gramps/4/.local/share/gramps/gramps60/plugins/GraphView/graphview.py", line 1551, in populate
    self.bold_size, self.norm_size = self.fit_text()
                                     ^^^^^^^^^^^^^^^
  File "/home/brian/snap/gramps/4/.local/share/gramps/gramps60/plugins/GraphView/graphview.py", line 1883, in fit_text
    text_font = font_fams[0] + ", " + font_sizes[0] + 'px'
                ~~~~~~~~~^^^
IndexError: list index out of range

This is disabling and only ‘close’ and selecting a different category, say Person, gets the Gramps interface back. Any further selection of ‘Charts’ plunges it back into this error. probably because Graphview is defaulted at this point.

I wonder if this may be related to ‘strict-confinement’ denying access to needed system resources.

Another opportunity for improvement might be to add a wiki entry for Gramps-core installation via ‘snaps’ and any tips and hints and known issues.

Snap installation is likely a good thing IMHO (improved modularity, cybersecurity, etc) but maybe there should be some documentation about installing popular add-ons and their pre-requisites to a ‘strictly-confined’ snap installation of Gramps. If that’s what this is, of course.
Brian

I wonder if it has something to do with Themes addon preferences?

Try changing the font and theme selected there. Then set back to the original settings. That might rebuild the font list.

I tried three or four different themes and a random selection of fonts and sizes but no difference was seen.
Deleting the graphview add-on returns everything to normal, but what a shame to lose both it and FTV!
fc-list shows everything located in /usr/share/fonts/ which may not be within the strict-confinement. I don’t yet have the skill to determine that. I should rely on more experienced head for that.
[edited to include the output of fc-list]

I can reproduce the error. I’ll investigate.

1 Like

FWIW…the same error on same line of Ubuntu 24.04 with snap of Gramps 6.0.3 so not Fedora’s prob nor Ubuntu’s.
brian

It may be because I forgot to add the librsvg2 package to the Snap. I’ll add it and let you know if it solves the problem.

1 Like

The problem is that graphviz is not configured correctly within the Snap.

Running dot -Tsvg as is done in the Graph View addon gives:

Format: "svg" not recognized. Use one of:

The output of dot -v gives:

dot - graphviz version 2.43.0 (0)
There is no layout engine support for "dot"
Perhaps "dot -c" needs to be run (with installer\'s privileges) to register the plugins?

I’m not sure how to fix this.

The output formats for graphviz are provided by plugins. These require two extra packages:

  • libfreetype6
  • libglib2.0-0t64

Running dot -c generates a new config file.

I’ve added the missing dependencies, but can’t get the config file included in the Snap yet.