Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs builds are failing with Sphinx 5.2.0.post0 #39

Closed
briantist opened this issue Sep 24, 2022 · 8 comments
Closed

Docs builds are failing with Sphinx 5.2.0.post0 #39

briantist opened this issue Sep 24, 2022 · 8 comments

Comments

@briantist
Copy link
Contributor

Sphinx 5.2.0 was just released today:

I haven't been able to figure out why yet, but at least in community.hashi_vault the docs build is failing with:

Reason: ValueError('too many values to unpack (expected 3)')

I first noticed it after making an innocuous change to a previously passing build (adding license header comments):
https://github.com/ansible-collections/community.hashi_vault/actions/runs/3119998619/jobs/5060610693#step:8:126

In CI it's coming up on my inclusion of changelog in the docsite:

Theme error:
An error happened in rendering the page collections/community/hashi_vault/docsite/CHANGELOG.
Reason: ValueError('too many values to unpack (expected 3)')

When I tried to reproduce it locally, I couldn't, until I upgraded the requirements (after having installed them fresh a few hours earlier) and saw that it upgraded sphinx from 5.1.1 to 5.2.0.post0, after thatI could repro, but it came up on a different file, so I don't think it's related to anything I'm doing:

Theme error:
An error happened in rendering the page collections/community/hashi_vault/docsite/about_hashi_vault_lookup.
Reason: ValueError('too many values to unpack (expected 3)')

There's at least one other report of a failing build with it:

@AA-Turner
Copy link

Hi,

Are you able to provide a consistently failing minimal example? If this is a regression in Sphinx 5.2 I'd like to fix it sooner rather than later.

A

@felixfontein
Copy link
Collaborator

From this comment it seems that this problem is not related to antsibull-docs, but to the sphinx-rtd-theme that sphinx_ansible_theme is based on.

I verified this myself, with the following simple patch to sphinx-rtd-theme, both my docsite (using sphinx-rtd-theme directly) and another test docs build (using sphinx_ansible_theme)

diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html
index 1d70119..c9c07b9 100644
--- a/sphinx_rtd_theme/layout.html
+++ b/sphinx_rtd_theme/layout.html
@@ -10,7 +10,7 @@
 {%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%}
 
 {# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
-{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
+{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.', 2) | map('int') -%}
 {%- set sphinx_version_info = (_ver_major, _ver_minor, _ver_bugfix) -%}
 
 <!DOCTYPE html>

(I prefer the fix in readthedocs/sphinx_rtd_theme#1344, it's definitely more future-proof.)

@AA-Turner I guess the only fix you can do on the Sphinx side is make sure sphinx-rtd-theme is happy with Sphinx's version number... though that's only fixing symptoms, since the real bug IMO is in the sphinx-rtd-theme...

@felixfontein
Copy link
Collaborator

felixfontein commented Sep 25, 2022

I've created #40 that will hopefully fix the CI problems for now by avoiding Sphinx 5.2.0.post0. This is an ugly workaround, and I hope sphinx-rtd-theme is fixed very soon so we can again remove this workaround...

EDIT: 5.2.0 → 5.2.0.post0

@briantist briantist changed the title Docs builds are failing with Sphinx 5.2.0 Docs builds are failing with Sphinx 5.2.0.post0 Sep 25, 2022
@AA-Turner
Copy link

Sphinx 5.2.1 has been released.

A

@samccann
Copy link
Contributor

FWIW the Ansible nightly docs build is working fine today with Sphinx 5.2.1

@AA-Turner
Copy link

FWIW the Ansible nightly docs build is working fine today with Sphinx 5.2.1

Thanks for confirming the fixes in Sphinx 5.2.1 worked Sandra--thanks to all for the quick reports in the first instance.

A

@samccann
Copy link
Contributor

readthedocs/sphinx_rtd_theme#1343 is the issue where this would get fixed in the sphinx_rtd_theme to prevent this from happening in the future.

@felixfontein
Copy link
Collaborator

Closing since this problem went away due to Sphinx 5.2.1 (and hopefully the root cause will also go away soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants