Readthedocs.org: Build Fails With TypeError: connect() got an unexpected keyword argument 'priority'

Created on 7 Apr 2020  路  14Comments  路  Source: readthedocs/readthedocs.org

Details

I have been building my project documentation on RTD for a while. However I noticed that about 2 days ago my builds started failing. I created a new branch, debug, which checked out the last successfully built version on RTD. However, it now fails with the same
error message as my latest build, this makes me suspect that its not purely an issue on my end. I'm specifically working on the molecular_cleanup branch of my project, not on master.

As far as I can tell, both the last sucessful build and and the currently failing builds are using Shinx v.2.4.4, which is why I'm posting here and not on the sphinx project.

I have also managed to successfully build the docs locally.

  • Read the Docs project URL:

https://stk.readthedocs.io/en/latest/

  • Build URL (if applicable):

https://stk.readthedocs.io/en/molecular_cleanup/

RTD username: lukasturcani

Expected Result

Successful build, or error message related to code from my project.

Actual Result

I receive the error

Running Sphinx v2.4.4
loading translations [en]... done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/application.py", line 241, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/application.py", line 397, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/registry.py", line 465, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/builders/dirhtml.py", line 58, in setup
    app.setup_extension('sphinx.builders.html')
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/application.py", line 397, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/registry.py", line 465, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1234, in setup
    app.connect('config-inited', convert_html_css_files, priority=800)
TypeError: connect() got an unexpected keyword argument 'priority'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/stk/conda/debug/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1234, in setup
    app.connect('config-inited', convert_html_css_files, priority=800)
TypeError: connect() got an unexpected keyword argument 'priority'
The full traceback has been saved in /tmp/sphinx-err-hs2bz0ie.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Support

All 14 comments

Yes, just tried this. Did not fix it.

Second this, as i get the exact same error. Wiped the environment, didn't help. Tried to build a stable version that had build successfully before, but it now returns the same error.

Fixed it (temporarily) by pinning Sphinx to an earlier version in my rtd environment. I used Sphinx==2.2.1 because that's the version i had installed locally and it worked. But clearly it might work with other versions.

I did the same, using 3.0.0, which is the version I used for my local build. Also worked as a fixed for now.

Incidentally, I think I found another bug while doing this. When using my conda environment to specify the Sphinx version, RTD did not use the version I requested. I had to switch from an environment.yml to a requirements.txt for RTD to use the requested Sphinx version.

Thank you!

@lukasturcani @stsewd I am having this same issue now but I don't know if I should pin sphinx or ask for the feature flag to be enabled for my project, could you clarify which to do? if I pin the versions what versions should I use and should they be in the requirements.txt or in the conda env for the docs?

@AndrewAnnex which feature flag do you mean?

@stsewd the one from the issue you referenced https://github.com/readthedocs/readthedocs.org/issues/3829#issuecomment-515765278, CONDA_APPEND_CORE_REQUIREMENTS.

no clue if that is the correct solution hence my question. In a branch I attempted to use an older sphinx version using the requirements.txt for the docs but it looks like the build goes ahead and uses 2.4.4? in short I am not sure why those builds now work...

Hi all! This issue doesn't seem to be Read the Docs related.

If you are using conda on Read the Docs and want to pin your Sphinx dependency, please request CONDA_APPEND_CORE_REQUIREMENTS to be enabled in your project sending us an email.

If you are using pip, you can just add your pinned Sphinx dependency in your requirements.txt file.

I'm closing this for now but feel free to re-open if you consider this is still valid.

It looks like the original issue is caused by a mix of a pip installation and a conda one.

Would it be possible to add a feature flag to indicate "don't include any dependencies automatically, I promise to include them myself"? That way we could choose whether to install them with pip or conda.

In fact, I think the issue is that rtd invokes:

python /home/docs/checkouts/readthedocs.org/user_builds/cocotb/conda/1706/bin/sphinx-build ...

Which is the conda binary, even if the Sphinx that is importable is from pip.

I think the problem would go away if this invocation were changed to

python -m sphinx ...

This is guaranteed to always invoke the same Sphinx as the one that is importable.

Patch in #6965

Was this page helpful?
0 / 5 - 0 ratings

Related issues

humitos picture humitos  路  3Comments

davidfischer picture davidfischer  路  4Comments

jaraco picture jaraco  路  4Comments

goerz picture goerz  路  4Comments

boscorelly picture boscorelly  路  4Comments