crate / crate-docs-theme

A Sphinx theme for the CrateDB documentation.

Home Page:https://crate-docs-theme.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with RTD footer loading (readthedocs-doc-embed.js)

amotl opened this issue · comments

@msbt reported at #277 (comment) about those errors in the JavaScript console:

Error loading Read the Docs footer [readthedocs-doc-embed.js]
Error registering page view [readthedocs-doc-embed.js]

Indeed, they can be observed on:

This is probably another aftermath coming from #255, like #283.

Do you have any idea what actually got broken here or how we would fix it, @msbt?

@msbt just shared this with me. Thank you.

image

image

This is the reproduction of the error message in ASCII format.

GET https://crate.io/_/api/v2/footer_html/?callback=callback&project=crate&version=4.5&page=index&theme=crate&format=jsonp&docroot=%2Fdocs%2F&source_suffix=.rst         [HTTP/2 404 Not Found 25ms]
XHR GET https://crate.io/_/api/v2/analytics/?project=crate&version=4.5&absolute_uri=https%3A%2F%2Fcrate.io%2Fdocs%2Fcrate%2Freference%2Fen%2F4.5%2F&_=1622458056827      [HTTP/2 404 Not Found 384ms]
Error loading Read the Docs footer                                                                                                                                       readthedocs-doc-embed.js:1:23071

It might be an issue related to CORS and friends?

@amotl I reckon this is a redirect issue. If you visit this url (which is the equivalent of the url above on RTD)

https://crate.readthedocs.io/_/api/v2/analytics/?project=crate&version=4.5&absolute_uri=https://crate.io/docs/crate/reference/en/4.5/&_=1622459181879

the page opens fine, but if you adjust the URL to fit our proxy/rewrite setup

https://crate.io/docs/crate/reference/_/api/v2/analytics/?project=crate&version=4.5&absolute_uri=https%3A//crate.io/docs/crate/reference/en/4.5/&_=1622459181879

it forwards to (mind the /en/4.5/) and results in a 404

https://crate.io/docs/crate/reference/en/4.5/_/api/v2/analytics/?project=crate&version=4.5&absolute_uri=https%3A//crate.io/docs/crate/reference/en/4.5/&_=1622459181879

What is that anyways, did we enable some kind of new analytics feature? I thought we disabled it all because we're using our own solution.

What is that anyways?

I wanted to raise this question as well! ;] @autophagy created readthedocs/readthedocs.org#3233 the other day. Maybe this is related somehow?

Sure looks like it, but the question is why it is enabled now. This seems to be the source of that feature: https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/api/v2/templates/restapi/footer.html

The question is why it is enabled now?

Maybe @norosa can have a quick look at this?

So, do we agree that we do not want to make this feature work (we actually do not want to have the RTD footer, do we?), but, instead, leave the RTD footer off and additionally get rid of this error on the JavaScript console?

commented

@amotl I don't know anything about the footer. I would need to spend more time looking into the history here

my PR only fixes the broken redirects. this will reduce the errors in the console, reduce unnecessary traffic, and allow us to make use of any RTD feature (now or in the future) that uses this namespace. I think we should probably do that regardless of what is done about the footer

thoughts?

@norosa: Agreed. Thanks for the patch in order to silence those errors.