readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8k stars 3.58k forks source link

Latest Sphinx (7.3.7) corrupted install on mambaforge #11416

Closed aneeshnaik closed 2 months ago

aneeshnaik commented 3 months ago

Details

My docs are built using mambaforge. If I list sphinx as a dependency (without a version number), then mambaforge tries to install the latest version (7.3.7), which leads to a long chain of error messages like below, and the build fails.

CondaVerificationError: The package for sphinx located at /home/docs/.asdf/installs/python/mambaforge-22.9.0-3/pkgs/sphinx-7.3.7-py312h5eee18b_0
appears to be corrupted. The path 'bin/sphinx-apidoc'
specified in the package manifest cannot be found.

CondaVerificationError: The package for sphinx located at /home/docs/.asdf/installs/python/mambaforge-22.9.0-3/pkgs/sphinx-7.3.7-py312h5eee18b_0
appears to be corrupted. The path 'bin/sphinx-autogen'
specified in the package manifest cannot be found.

CondaVerificationError: The package for sphinx located at /home/docs/.asdf/installs/python/mambaforge-22.9.0-3/pkgs/sphinx-7.3.7-py312h5eee18b_0
appears to be corrupted. The path 'bin/sphinx-build'
specified in the package manifest cannot be found.

CondaVerificationError: The package for sphinx located at /home/docs/.asdf/installs/python/mambaforge-22.9.0-3/pkgs/sphinx-7.3.7-py312h5eee18b_0
appears to be corrupted. The path 'bin/sphinx-quickstart'
specified in the package manifest cannot be found.

However, if I list sphinx=7.2 then the build works as expected.

Here is my .readthedocs.yaml file:

version: 2

build:
  os: ubuntu-22.04
  tools:
    python: "mambaforge-22.9"

sphinx:
  configuration: docs/source/conf.py

conda:
  environment: docs/environment.yml

And here is the version of the environment.yml file that does not work:

channels:
  - defaults
  - conda-forge
dependencies:
  - sphinx
  - sphinx-book-theme
  - numpy
  - numpydoc
  - myst-nb=1.0.0
  - lintsampler
  - matplotlib
  - scipy
  - scikit-learn

Here is an example of a failed build using this environment.yml file.

humitos commented 3 months ago

Hi. Can you reproduce this issue locally?

aneeshnaik commented 3 months ago

No, the docs build if I try locally with the same conda environment.

victorlin commented 3 months ago

Solution:

-     python: "mambaforge-22.9"
+     python: "mambaforge-23.11"

I did some searching on the root error message which wasn't included in the issue description but you can see it in the build log that's linked:

critical libmamba Pathname can't be converted from UTF-8 to current locale.
Preparing transaction: ...working... done
Verifying transaction: ...working... failed

and came across https://github.com/conda-forge/python-libarchive-c-feedstock/issues/35#issuecomment-1623133587. This is a known bug in mamba versions <1.4.7. The mambaforge version used here, 22.9, bundles mamba 1.1.0. The next available mambaforge version, 23.11, bundles mamba 1.5.5.

humitos commented 2 months ago

@victorlin thanks for posting the solution here! 🙏🏼

@aneeshnaik can you try using mambaforge-23.11 and let us know if it solves the issue?

aneeshnaik commented 2 months ago

Just tested building the docs with mambaforge-23.11 and everything builds without error, even if I remove the sphinx version spec so that it uses the latest sphinx version (7.3.7).

In summary, @victorlin's solution works --- thank you for looking into this!

humitos commented 2 months ago

Great! Thanks for replying here. I'm going to close this issue then, since it's not an issue on Read the Docs and there isn't anything actionable from our side.