Linekio / getmyancestors

Get GEDCOM files from FamilySearch.org
Other
163 stars 40 forks source link

KeyError: 'value' in getmyancestors.py line 501 #15

Closed RaidoWolf closed 5 years ago

RaidoWolf commented 5 years ago

Running on commit b97dbe5ed7829f9618339da7022a1838148f3687, I am getting the following error many hours into a large download. I'm not sure what additional details might help resolve this, but I'm happy to provide any info you might need.

Traceback (most recent call last):
  File "getmyancestors.py", line 1008, in <module>
    todo = tree.add_children(todo) - done
  File "getmyancestors.py", line 841, in add_children
    self.add_indis(set.union(*(set(rel) for rel in rels)))
  File "getmyancestors.py", line 757, in add_indis
    loop.run_until_complete(add_datas(loop, data))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
    return future.result()
  File "getmyancestors.py", line 744, in add_datas
    await future
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "getmyancestors.py", line 501, in add_data
    self.notes.add(Note('=== ' + self.tree.fs._('Life Sketch') + ' ===\n' + x['value'], self.tree))
KeyError: 'value'
Linekio commented 5 years ago

Hi,

Could you send me the log file ?

RaidoWolf commented 5 years ago

For sure, I just sent an email to you with the log file.

I've also noticed that the portion printed to stdout indicated that the error immediately occurred after attempting to download the first generation of descendants, which do not exist for the starting person in this download, so I am re-running the command with 0 generations of descendants. I suppose that is a possible reason for this error, but I imagine that should be a handled case instead of a KeyError.

Linekio commented 5 years ago

The error means that the ancestor has a life sketch, but this life sketch has no value, which is normally impossible. This is probably due to an error in the FamilySearch database, this happens sometimes. Maybe there is only one ancestor in all FamilySearch which have this error... I didn't find which ancestor has the error, but the log file does not seem complete?

So, I think I just had to add a condition.

RaidoWolf commented 5 years ago

That definitely makes sense. I'm not sure which ancestor has this issue either. I double checked the log file, and I did indeed include all lines up to the end in the email I sent. I was able to run the download again with descendants set to 0 generations, and the error did not occur in that case, but occurs every time I run it with descendants set to a non-zero value.

Linekio commented 5 years ago

I can't reproduce the bug so could you test with this version ? getmyancestors.zip

RaidoWolf commented 5 years ago

Sorry for the delay. I tested this code a few times, and although I am no longer getting a stack trace indicating failure, the GED file ends up being 0 bytes after completion. The last message in console says that it was attempting to download generation 2 of descendants, and the log file looks very similar to last time, with no error message or stack trace present.

Linekio commented 5 years ago

Are there any HTTP errors in the log file ? Have you tried with a smaller number of ascendants? The complete log file could help me.

Linekio commented 5 years ago

Close since no answer for months and probably fixed since https://github.com/Linekio/getmyancestors/commit/8a4b5965277173db45a1522d4d19bc0a1ecddb4a