Cannot export to Gedcom

Hi all, after marking several records as private, I cannot export my tree to Gedcom, getting this error:

216921: ERROR: _exportassistant.py: line 597: Error exporting your Family Tree
Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\gui\plug\export\_exportassistant.py", line 593, in save
    self.option_box_instance)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 1595, in export_data
    ret = ged_write.write_gedcom_file(filename)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 248, in write_gedcom_file
    self._individuals()
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 411, in _individuals
    self._person(self.dbase.get_person_from_handle(data[1]))
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 454, in _person
    self._assoc(person, 1)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 475, in _assoc
    self._source_references(ref.get_citation_list(), level + 1)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 686, in _source_references
    self._source_ref_record(level, citation_handle)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\plugins\export\exportgedcom.py", line 1348, in _source_ref_record
    src_handle = citation.get_reference_handle()
AttributeError: 'NoneType' object has no attribute 'get_reference_handle'

Export works correctly if I DON’T mark the “Do not include records marked as private” option, but if I do, I always get this error. Web report without private data works nicely.

Any help will be greatly appreciated.

GRAMPS: AIO64-5.1.5-1
Python: 3.6.4 (default, Jan 23 2018, 13:17:37) …
BSDDB: 6.1.0 (6, 0, 30)
sqlite: 3.21.0 (2.6.0)
LANG: en_GB.UTF-8
OS: Windows

Does export with Example.gramps?

1 Like

Yes, after marking some data as private, exporting example.gramps to Gedcom works fine.

I’ve exported my own tree many times to Gedcom without any problem before. The problem has just happened today, after marking several data (mostly citations, sources and notes) as private to import it to an online provider, as I usually do. I haven’t installed any plug-in in the last days. Restarting the computer doesn’t fix the problem.
Export to other formats works as expected, so as a workaround I can export to .gpkg (without private data), import the resulñting file into a new tree and export to Gedcom, but I’d really like to export to GEDCOM from my originally tree as I usually do.

In that case do a full normal backup without media and restore to new familytree and see if the issue/corruption of your existing familytree still happens for you?

1 Like

Thanks for the suggestion, but unfortunately that doesn’t work either (I’m getting the same error).

Tools > Check & Repair Database also doesn’t fisx the problem.

1 Like

This looks like a bug. The error message indicates that the software can’t deal with a situation where a citation is suddenly empty, because of its privacy settings.

Would it be possible to attach a small export in .gramps format to a bug report, so that a developer can test this export, and see what it does?

2 Likes

Yes. This is a bug. If a person has an association with a private citation, then exporting to Gedcom with private records excluded causes this error.

I have a fix. Has a report been filed on the bug tracker?

4 Likes

Thanks both for confirming it’s a bug!

Yes. unmarking all my citations as “private” fixes the problem. Marking them as private one by one and them exporting to Gedcom (no private date) has allowed me to identify the particular citation that is causing the problem, one ciation with a lot of references across my tree.

Due to the private nature of the data I would prefer not sharing my tree in the bug report if it’s not 100 necessary, so I’ll see if I can find a way to reproduce the problem using a new database instead, and then will submit a proper bug report.

I’m not a technical user, so if anyone have a hint, i’d really aprreciate it.

Edit: just found it, it was clearly described in Nick’s response:
If a person has an association with a private citation

I’ve submitted a bug report, thanks to everyone :slight_smile:
https://gramps-project.org/bugs/view.php?id=12886

2 Likes

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