readthedocs.org: Could not import extension sphinx.builders.linkcheck (exception: urllib3 v2.0 only supports OpenSSL 1.1.1+)
Details
- Read the Docs project URL: https://readthedocs.org/projects/gitlab-board
- Build URL (if applicable): https://readthedocs.org/projects/gitlab-board/builds/20387388/
- Read the Docs username (if applicable): https://readthedocs.org/profiles/stereoshoots/
Expected Result
New revision of docs should be builded.
Actual Result
Error is thrown:
Could not import extension sphinx.builders.linkcheck (exception: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2n 7 Dec 2017. See: https://github.com/urllib3/urllib3/issues/2168)
Is this a problem on my side? It installs pip packages in build, how should i fix this?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 22
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Fix readthedocs build error See https://github.com/readthedocs/readthedocs.org/issues/10290 — committed to moi90/morphocut by moi90 a year ago
- Fix readthedocs build error (#112) See https://github.com/readthedocs/readthedocs.org/issues/10290 — committed to morphocut/morphocut by moi90 a year ago
- Fix readthedocs build error (#112) See https://github.com/readthedocs/readthedocs.org/issues/10290 — committed to saeedehsp/morphocut by moi90 a year ago
- `.readthedocs.yml`: Add `build:` entry to avoid old docker images This follows the advice from https://github.com/readthedocs/readthedocs.org/issues/10290#issuecomment-1535120995 to address https://g... — committed to spinalcordtoolbox/spinalcordtoolbox by joshuacwnewton a year ago
- fix missing urllib+libopenssl dependency for readthedocs (relates to https://github.com/readthedocs/readthedocs.org/issues/10290) — committed to Ouranosinc/cowbird by fmigneault a year ago
- doc:fix readthedocs build error (https://github.com/readthedocs/readthedocs.org/issues/10290) Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn> — committed to QQxiaoming/quard_star_tutorial by QQxiaoming a year ago
- doc:fix readthedocs build error (https://github.com/readthedocs/readthedocs.org/issues/10290) Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn> — committed to QQxiaoming/quard_star_tutorial by QQxiaoming a year ago
- Add RTD configuration to work around readthedocs/readthedocs.org#10290 — committed to waveform80/structa by waveform80 a year ago
- Update build os for readthedocs Should fix urllib3 2.0 issue https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Max H. Gerlach <git@maxgerlach.de> — committed to horovod/horovod by maxhgerlach a year ago
- Add readthedocs config file to fix build. https://github.com/readthedocs/readthedocs.org/issues/10290 — committed to pika/pika by lukebakken a year ago
- Add readthedocs config file to fix build. https://github.com/readthedocs/readthedocs.org/issues/10290 (cherry picked from commit 2e689bae5ff838cf9c559fa558158a0b12d47fd9) — committed to pika/pika by lukebakken a year ago
- fix(docs): Use new readthedocs config References: - urllib3/urllib3#2168 - readthedocs/readthedocs.org#10290 - https://docs.readthedocs.io/en/stable/config-file/v2.html#legacy-build-specification ... — committed to Pycord-Development/pycord by BobDotCom a year ago
- fix(docs): Fix readthedocs build failures (#2046) fix(docs): Use new readthedocs config References: - urllib3/urllib3#2168 - readthedocs/readthedocs.org#10290 - https://docs.readthedocs.io/en/s... — committed to Pycord-Development/pycord by BobDotCom a year ago
- Ensure CI avoids older ReadTheDocs docker images to address OpenSSL mismatch (#4114) * `.readthedocs.yml`: Add `build:` entry to avoid old docker images * `.readthedocs.yml`: Move Python version to ... — committed to spinalcordtoolbox/spinalcordtoolbox by joshuacwnewton a year ago
- core(docs): Fix doc-build failing due to an issue with urllib https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Mathieu <80390413+mccoderpy@users.noreply.github.com> — committed to mccoderpy/discord.py-message-components by mccoderpy a year ago
- core(docs): Fix doc-build failing due to an issue with urllib https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Mathieu <80390413+mccoderpy@users.noreply.github.com> — committed to mccoderpy/discord.py-message-components by mccoderpy a year ago
- core(docs): Fix doc-build failing due to an issue with urllib https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Mathieu <80390413+mccoderpy@users.noreply.github.com> — committed to mccoderpy/discord.py-message-components by mccoderpy a year ago
- core(docs): Fix doc-build failing due to an issue with urllib https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Mathieu <80390413+mccoderpy@users.noreply.github.com> — committed to mccoderpy/discord.py-message-components by mccoderpy a year ago
- core(docs): Fix doc-build failing due to an issue with urllib https://github.com/readthedocs/readthedocs.org/issues/10290 Signed-off-by: Mathieu <80390413+mccoderpy@users.noreply.github.com> — committed to mccoderpy/discord.py-message-components by mccoderpy a year ago
- Update .readthedocs.yml Doc build was failing https://github.com/readthedocs/readthedocs.org/issues/10290 — committed to gilch/hissp by gilch a year ago
More specifically, you should use a configuration file that that specifies the build OS.
That is, add a
.readthedocs.yaml
file in your repository root:This will ensure you are not using one of the older images.
Edit: updated to mention
build.tools
@stsewd I suspect this issue will get a lot of traffic, if possible could the correct answer w/ example of upgrading to
build.os: ubuntu-22.04
instead of pinning urllib3 be elevated to the first reply. I suspect folks may be looking for quick solutions to this incompatibility and I’d like people to keep urllib3 unpinned if it’s not blocked by anything else in their environment.Hi, this is because urlib3 was released yesterday, and that version isn’t compatible with the docker image you are using. To use a more recent version of our docker images, please use a config file (https://docs.readthedocs.io/en/stable/config-file/v2.html),
or pin urllib3 in your requirements to a previous version.Edit: projects should use a configuration file and leave urllib3 unpinned
Hi! Thank you all for reporting this issue and for your patience 😄 .
TLDR; new Docker images with SSL 1.1.1 were deployed and they are ready to use. If your project was failing because of this, it should not be failing anymore. If you still have this problem or you find another one that looks related to the rebuild of the images, please open a new issue.
Here I’m writing down the news about this problem:
The root cause
Read the Docs still supports some old Docker images [^1] that contains Python versions compiled with SSL 1.0.x and this SSL version was dropped support from
urlib3
in its latest release.urllib3
is used byrequests
behind the scenes andrequests
is used by a lot of things; in particular Sphinxlinkcheck
command where this was originally found.The workaround
Upgrade your
.yaml
file to usebuild.os: ubuntu-22.04
as mentioned in https://github.com/readthedocs/readthedocs.org/issues/10290#issuecomment-1535120995Besides being a workaround, this upgrade is useful to be up-to-date with the latest version of the RTD config file, which introduces you to some nice features like build customization
The solution
We re-built the Docker images so they use SSL 1.1.1 to compile the Python versions via
pyenv
. This should be transparent for all the projects and they should not notice any new error, 🤞🏼The future
SSL 1.1.1 is gonna be unsupported later this year as well, based on https://github.com/urllib3/urllib3/issues/2168; so, we are thinking about deprecating and removing these Docker images (and the whole
build.image
key) completely before that time. We need to keep talking about this and how to do it without breaking lot of projects.[^1]: this is
build.image
key in the config file with any of the valuesstable
,latest
andtesting
. A lot of users were hitting this becausebuild.image: latest
with Python 3.7 is still the default; but we are working on changing this default to a more up-to-date version of Ubuntu and Python as well. Please, if you are usingbuild.image
in your.yaml
file, upgrade it tobuild.os: ubuntu-22.04
as mentioned in https://github.com/readthedocs/readthedocs.org/issues/10290#issuecomment-1535120995If another poor soul is here from using the readthedocs template, here’s what worked for me.
Add the
.readthedocs.yaml
at the root of your repo. Note thedocs/source/conf.py
, which can be easily overlooked from the config file example.Also, I opened an issue yesterday for updating and fixing the legacy build image: https://github.com/readthedocs/readthedocs-docker-images/issues/194
We’ll track updating and fixing the image there. I’ll see what I can do today and tomorrow
@stereoshoots check your build output for errors/warning in the Sphinx build command. The upgrade to the operating system image also means there were a number of dependencies changed in the process.
@RemDelaporteMathurin it’s not just
version: 2
that is required to avoid the bug here, but specificallybuild.os: ubuntu-22.04
.@sethmlarson Thanks for the note, I’d agree the configuration fix should be the recommended fix. I’ll edit the guidance above.
It seems like we’re probably going to aim to get some sort of fix out here, as this is causing a bit of trouble for folks. It seems the trouble is an old pyenv compiled Python in an image we’re trying to deprecate, but should be something we can fix.
Unfortunately, we’re going into Write the Docs conference time, so we haven’t settled on a timeframe yet.
I was having this error for at least 2 days. Now I was able to compile the documentation without any problems. Looks like fixed. Great!
We haven’t heard people hitting any new issue after the deploy with the fix we did yesterday; so I’m going to close this issue.
If you are arrive at this issue by browsing the internet, please refer to this comment in particular https://github.com/readthedocs/readthedocs.org/issues/10290#issuecomment-1542841524
Thanks you all for the support! ❤️
@BeyondEvil it’s still recommended general to use an automated process to explicitly pin all of your direct and transitive dependencies.
But on the other hand, I wouldn’t recommend that solution as a fix here either. This requires additional tooling like pip-tools to automate. For the basic user, the direct fix above is the easiest first step, but defining dependencies explicitly is a great idea still
@BeyondEvil Correct! If you do add a pinned dependency your project should indeed be okay, especially if you have followed the guide for reproducible builds.
Thanks @mmmarinho! You saved my day! I didn’t realise it was
docs/conf.py
and notdocs/source/conf.py