sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.51k stars 2.12k forks source link

File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/environment/collectors/__init__.py", line 59, in merge_other raise NotImplementedError #8497

Closed silverlight-jjm closed 3 years ago

silverlight-jjm commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

# Sphinx version: 2.1.2
# Python version: 3.8.5 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.10.1
# Last messages:
#   reading sources... [ 36%] collections/index_vars .. dev_guide/style_guide/index
#   reading sources... [ 45%] dev_guide/style_guide/resources .. dev_guide/testing/sanity/replace-urlopen
#   reading sources... [ 54%] dev_guide/testing/sanity/required-and-default-attributes .. network/user_guide/network_best_practices_2.5
#   reading sources... [ 63%] network/user_guide/network_debug_troubleshooting .. porting_guides/porting_guide_2.7
#   reading sources... [ 72%] porting_guides/porting_guide_2.8 .. scenario_guides/guide_rax
#   reading sources... [ 81%] scenario_guides/guide_scaleway .. user_guide/index
#   reading sources... [ 90%] user_guide/intro .. user_guide/vault
#   reading sources... [100%] user_guide/windows .. user_guide/windows_winrm
#   
#   waiting for workers...
# Loaded extensions:
#   sphinx.ext.mathjax (2.1.2) from /home/ansible/.local/lib/python3.8/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from /home/ansible/.local/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from /home/ansible/.local/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.3) from /home/ansible/.local/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.4) from /home/ansible/.local/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from /home/ansible/.local/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /home/ansible/.local/lib/python3.8/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (2.1.2) from /home/ansible/.local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.intersphinx (2.1.2) from /home/ansible/.local/lib/python3.8/site-packages/sphinx/ext/intersphinx.py
#   pygments_lexer (0.1.0) from /home/ansible/codes/ansible/docs/docsite/_extensions/pygments_lexer.py
#   notfound.extension (0.5) from /home/ansible/.local/lib/python3.8/site-packages/notfound/extension.py
Traceback (most recent call last):
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 284, in build_main
    app.build(args.force_all, filenames)
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/application.py", line 345, in build
    self.builder.build_update()
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 317, in build_update
    self.build(to_build,
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 332, in build
    updated_docnames = set(self.read())
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 436, in read
    self._read_parallel(docnames, nproc=self.app.parallel)
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 491, in _read_parallel
    tasks.join()
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/util/parallel.py", line 110, in join
    self._join_one()
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/util/parallel.py", line 121, in _join_one
    self._result_funcs.pop(tid)(self._args.pop(tid), result)
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 480, in merge
    self.env.merge_info_from(docs, env, self.app)
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/environment/__init__.py", line 316, in merge_info_from
    self.events.emit('env-merge-info', self, docnames, other)
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/events.py", line 103, in emit
    results.append(callback(self.app, *args))
  File "/home/ansible/.local/lib/python3.8/site-packages/sphinx/environment/collectors/__init__.py", line 59, in merge_other
    raise NotImplementedError
NotImplementedError

To Reproduce Steps to reproduce the behavior:

<Paste your command-line here which cause the problem>

$ git clone https://github.com/.../some_project
$ cd some_project
$ pip install -r requirements.txt
$ cd docs
$ make html SPHINXOPTS="-D language=de"
$ # open _build/html/index and see bla bla

Expected behavior A clear and concise description of what you expected to happen.

Your project Link to your sphinx project, or attach zipped small project sample.

Screenshots If applicable, add screenshots to help explain your problem.

Environment info

Additional context Add any other context about the problem here.

tk0miya commented 3 years ago

Please fill our template. I can't understand what is happened.

silverlight-jjm commented 3 years ago

I want to build ansible docsite. git clone https://github.com/ansible/ansible.git cd ansible make website image python -m pip install -r requirements.txt python -m pip install -r docs/docsite/requirement.txt source hacking/env-setup make webdocs

than report error

silverlight-jjm commented 3 years ago

building [mo]: targets for 0 po files that are out of date building [html]: targets for 478 source files that are out of date updating environment: [new config] 478 added, 0 changed, 0 removed reading sources... [ 20%] collections/ansible/builtin/getent_module .. collectioreading sources... [ 30%] collections/ansible/builtin/replace_module .. collectireading sources... [ 40%] collections/index_module .. dev_guide/platforms/vmwarereading sources... [ 50%] dev_guide/style_guide/basic_rules .. dev_guide/testingreading sources... [ 60%] dev_guide/testing/sanity/pylint .. network/getting_stareading sources... [ 80%] porting_guides/porting_guide_2.10 .. scenario_guides/greading sources... [ 90%] scenario_guides/guide_online .. user_guide/modules_intreading sources... [100%] user_guide/modules_support .. user_guide/windows_winrm waiting for workers... Extension error: Handler <bound method EnvironmentCollector.merge_other of <notfound.extension.OrphanMetadataCollector object at 0x7f133c6a7be0>> for event 'env-merge-info' threw an exception (exception: )

tk0miya commented 3 years ago

Handler <bound method EnvironmentCollector.merge_other of <notfound.extension.OrphanMetadataCollector object at 0x7f133c6a7be0>> for event 'env-merge-info' threw an exception (exception: )

This error came from this 3rd party extension named notfound.extension.OrphanMetadataCollector. Please report this to their project or ask how to build the document to ansible project. Thanks,

samccann commented 3 years ago

@silverlight-jjm - The workaround for building ansible docs for now is to either downgrade sphinx-notfound-page to 0.4 (pip install sphinx-notfound-page==0.4) or run it from source ( pip install git+https://github.com/readthedocs/sphinx-notfound-page.)

It seems the problem has been resolved there but not in an official release yet.

dmsimard commented 3 years ago

More specifically the fix appears to be https://github.com/readthedocs/sphinx-notfound-page/commit/47887ecb35f42da29dd111f8a281a22ad4bf7412 which implements the merge_other method that sphinx complains about