googleapis / sphinx-docfx-yaml

Forked sphinx-docfx-yaml repository for creating DocFX YAML for Python Client Libraries
Apache License 2.0
5 stars 7 forks source link

sphinx.errors.ExtensionError: Handler <function build_finished> for event 'build-finished' threw an exception #224

Closed IlyaFaer closed 2 years ago

IlyaFaer commented 2 years ago

Hi!

We've got a failure of the docfx while building docs, like this:

Traceback (most recent call last):
  File "/home/runner/work/python-spanner-django/python-spanner-django/.nox/docfx/lib/python3.8/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/runner/work/python-spanner-django/python-spanner-django/.nox/docfx/lib/python3.8/site-packages/docfx_yaml/extension.py", line 1830, in build_finished
    obj['references'].append(_create_reference(attrData, parent))
  File "/home/runner/work/python-spanner-django/python-spanner-django/.nox/docfx/lib/python3.8/site-packages/docfx_yaml/extension.py", line 239, in _create_reference
    'name': datam['source']['id'],
KeyError: 'source'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/work/python-spanner-django/python-spanner-django/.nox/docfx/lib/python3.8/site-packages/sphinx/application.py", line 331, in build
    self.events.emit('build-finished', None)
  File "/home/runner/work/python-spanner-django/python-spanner-django/.nox/docfx/lib/python3.8/site-packages/sphinx/events.py", line 102, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function build_finished at 0x7f1fb3f89ee0> for event 'build-finished' threw an exception (exception: 'source')

Here is the full log: https://github.com/googleapis/python-spanner-django/runs/7320162836?check_suite_focus=true

Error message is not very helpful. As far as I understand, there is a wrong reference somewhere, but without any information about it in the traceback it's pretty challenging to figure which of the references is incorrect. Should be improved, I think.

dandhlee commented 2 years ago

Hey there, I've already opened an issue to look into it in https://github.com/googleapis/python-spanner-django/issues/768. The issue should be specific to the spanner django repo so I'll close this issue here.