Narrative Web Report Error cannot access local variable 'bletter' where it is not associated with a value

Got the following error anybody got any ideas as to where I should look to find out the cause suspect something in my tree not a bug
phil

62156: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/usr/lib/python3/dist-packages/gramps/plugins/webreport/narrativeweb.py", line 538, in write_report
    self.tab["Person"].display_pages(the_lang, the_title)
  File "/usr/lib/python3/dist-packages/gramps/plugins/webreport/person.py", line 181, in display_pages
    self.individuallistpage(
  File "/usr/lib/python3/dist-packages/gramps/plugins/webreport/person.py", line 557, in individuallistpage
    max_rows = max_letter_rows[bletter]
                               ^^^^^^^
UnboundLocalError: cannot access local variable 'bletter' where it is not associated with a value

GRAMPS: 5.2.4
Python: 3.11.2
BSDDB: 6.2.9 (5, 3, 28)
sqlite: 3.40.1 (2.6.0)
LANG: en_GB.UTF-8
OS: Linux
Distribution: 6.1.0-30-amd64

It looks like this may be related to pull request #1896 - “New indexes for big databases in the narrative web report”.

Thanks Nick

My Family Tree is approx 18000 individuals, tried increasing the value
for the index from 500 to 2000 made no difference.
Will spend some more time on this and get back to you
phil

1 Like

Make a bug request for this problem.

We have a problem here. Did you modified the sources ?

The following instruction does not exist at line 557:

max_rows = max_letter_rows[bletter]

Serge

I run 2 PC’s a Pi5 running Bookworm and an i5 running LMDE6 both have
Version 5.2.4 with your mod for incl roles.
Both do have that line as described at line 557.
Neither has been updated or changed in the last 3 months.

I have subsequently run the report on the Pi using a simplified tree
with no problem.

I need to retrace all my steps to reproduce the error will get back to you
phil