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

RTD has error #1062

Closed
pllim opened this issue Aug 8, 2023 · 4 comments · Fixed by #1063
Closed

RTD has error #1062

pllim opened this issue Aug 8, 2023 · 4 comments · Fixed by #1063
Assignees

Comments

@pllim
Copy link
Collaborator

pllim commented Aug 8, 2023

Whatever you just pushed to main branch broke RTD. FYI.

https://readthedocs.org/projects/ginga/builds/21551221/

@pllim pllim added the bug label Aug 8, 2023
@pllim
Copy link
Collaborator Author

pllim commented Aug 8, 2023

Or maybe dependencies have changed since last week when it last built successfully. Your latest commit seems unrelated to this error.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/html/__init__.py", line 1098, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/readthedocs_ext/readthedocs.py", line 181, in rtd_render
    content = old_render(template, render_context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/jinja2glue.py", line 196, in render
    return self.environment.get_template(template).render(context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx_rtd_theme/layout.html", line 67, in top-level template code
    <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
jinja2.exceptions.UndefinedError: 'style' is undefined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/cmd/build.py", line 290, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 351, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 290, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 360, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 567, in write
    self._write_serial(sorted(docnames))
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 577, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/html/__init__.py", line 675, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ginga/envs/latest/lib/python3.9/site-packages/sphinx/builders/html/__init__.py", line 1105, in handle_page
    raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page FAQ.
Reason: UndefinedError("'style' is undefined")

Theme error:
An error happened in rendering the page FAQ.
Reason: UndefinedError("'style' is undefined")

@pllim
Copy link
Collaborator Author

pllim commented Aug 8, 2023

Apparently fixed in readthedocs/sphinx_rtd_theme#1464 , so need to figure why it is popping up, but I don't have time this week.

For now, maybe you can try readthedocs/readthedocs.org#10279 ?

@ejeschke
Copy link
Owner

ejeschke commented Aug 8, 2023

Whatever you just pushed to main branch broke RTD.

Hmm, was a pretty minor code fix for the GridBox widget with no change to documentation. Wondering if this is related to #1060...

@ejeschke
Copy link
Owner

ejeschke commented Aug 8, 2023

Looks like we will need to pin sphinx<7

ejeschke added a commit to naojsoft/ginga that referenced this issue Aug 8, 2023
ejeschke added a commit that referenced this issue Aug 9, 2023
…1063)

* Fix readthedocs build due to sphinx incompatibility with RTD theme

- fix #1062
- Try @pllim's alternate suggestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants