Addon Manager suddenly having error

Has the .json for the addon manager changed? [Yes, Format was changed to test PR#1523. New AIO build on 18 Aug 2023 fixes.] I’m suddenly getting the following error on 2 systems (a AIO install and a GitHub install on a Fedora box) when selecting the Settings tab in the 5.2 Addon Manager. If the Gramps project is deselected and ONLY the Isotammi project is selected, the error does NOT occur.

223181494: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug\_windows.py", line 120, in emit_signal
    self.callback(self.addon_list)
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug\_windows.py", line 516, in load_addons
    self.lb.add(AddonRow(self, addon, self.req, self.window))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug\_windows.py", line 220, in __init__
    lozenge = self.__create_lozenge(_("Type"), addon["t"])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug\_windows.py", line 330, in __create_lozenge
    label.set_text(text)
TypeError: Must be string, not int

on the pull it says addons must be rearranged before merge. I was going to ask what that meant.

Yes. I changed the plugin type from a string to an integer.

I’ll create another GrampsAIO with the updates.

1 Like

I’m getting the same error on manjaro cinnamon.

Ok. But why does it blow up when I’m changing tabs?

Shouldn’t something reading a file as changeable as the addonlist be less susceptible to erroring out due to a changed format?

Shouldn’t the .json file have a schema/version number so the parser module can be smarter? Smart enough to abort gracefully if the file is newer than the parser can handle or has a type mismatch?

I needed to make a slight change to the format when I fixed bug #12958. The format will remain fixed during the lifetime of a major release.

I’m not sure if it is worth validating the format of a listing file. We have never done so in the past. Maybe we can consider this for the future, but it also has downsides.

1 Like

I understand. But this will be the first time Gramps expects 3rd party projects. (The previous situation where is was more like it merely tolerated it.) So it is likely that there will be some malformed .json files.

The error message that was presented did not lead me to disable the ‘bad’ project.

It seems like a .txt file parser probably was moreprepared to ignore bad data too… perhaps more granularly too. (That may be wrong. It might have done a ‘silent’ failure. When the addonlist URL was incorrect, Gramps gave no indication. Failing to get an addonlist looked like the Addon Manager successfully checked and verfied everything was up-to-date. )

The validation is easy, but it adds python-jsonschema as an extra dependency. I’m not sure that is a good idea this late in the release cycle.

1 Like

Thanks. I will submit a 5.3 feature request.

I just built another beta GrampsAIO. Try it with this.

1 Like

Is there a patch I can apply to the Mac version to get a working Addon Manager? Or are there too many changes since the Mac bundle was created that are needed for this specific fix?

@Nick-Hall

This looks like a good point to have another set of 5.2 beta Assets? Maybe call it the Localization beta… it has all the new changes to make Gramps adapt to the OS language more seamlessly.

You already have the AIO generated for the Asset of the release collection.

Although, to be consistent with other releases, it should be the .exe that is currently in that .zip you linked above. (It is 100MB either way.) And follow the naming conventions : GrampsAIO-5.2.0-beta2_win64.exe

Or maybe that should be done after rolling in JRalls latest fix for locale

Yes, 5.2.0-beta2 should include all the latest fixes. I hope to release it within the next couple of days.

1 Like

That’s great! This beta cycle is addressing issues that are so tied to initial configurations that they could not be found without a public beta. And that required a broad cross-section of configurations.