Sporadic infinite load after update

AI-generated summary

Sporadic infinite load after update.

The issue started after upgrading to the latest software version. stuwest reported that some users can’t access the forum, with the page loading forever. The issue is inconsistent and only occurs sometimes for the same user on the same browser. Safe mode works, and stuwest has disabled all themes and plugins except for a few official Discourse plugins.

sam suggested disabling the unofficial discourse-anonymous-categories plugin, which stuwest did, but the issue persisted. Falco mentioned that removing the plugin from app.yml and rebuilding might make a difference.

supermathie suggested checking the console logs and network requests, which revealed a failed request to load a JavaScript file. stuwest confirmed that the site is behind Cloudflare, which was suspected to be the cause of the issue. supermathie recommended toggling off the CDN proxying, but instead stuwest cleared the cache, which solved the problem.

supermathie noted that if the issue recurs, disabling the CDN might be necessary and provided guidance on disabling Cloudflare features, specifically Rocket Loader, to resolve similar issues in the future.

I upgraded to the latest software version two days ago (our previous upgrade was on July 19), and since then some of our users can’t access the forum - it just loads forever.

This has been very difficult to debug since it’s not at all consistent. Sometimes the same user on the same browser can access the forum, and sometimes they can’t. Safe mode works, so I’ve pared back our themes to just the default Light and Dark, disabled all the theme components, disabled plugins apart from the following:

      - git clone https://github.com/discourse/docker_manager.git
      - git clone https://github.com/discourse/discourse-spoiler-alert.git
      - git clone https://github.com/communiteq/discourse-anonymous-categories.git
      - git clone https://github.com/discourse/discourse-bcc.git
      - git clone https://github.com/discourse/discourse-cakeday.git
      - git clone https://github.com/discourse/discourse-reactions.git
      - git clone https://github.com/discourse/discourse-data-explorer.git

I’ve ssh’d to the server and rebuilt the app, but users are still getting this sporadic hang. A couple of people sent me their JS console logs, which looked like this:

and (different user):

I’m stumped. Anyone got any suggestions?

I would first try without the unofficial plugin.

I’ve disabled that plugin, but users are still having the issue. Does it make any difference if I remove the plugin from app.yml and rebuild?

Yes, it makes a difference most of the time.

I’ve winnowed the plugins down to:

      - git clone https://github.com/discourse/docker_manager.git
      - git clone https://github.com/discourse/discourse-spoiler-alert.git
      - git clone https://github.com/discourse/discourse-bcc.git
      - git clone https://github.com/discourse/discourse-cakeday.git
      - git clone https://github.com/discourse/discourse-reactions.git
      - git clone https://github.com/discourse/discourse-data-explorer.git

and rebuilt the site, but users are still having the same issue. I’m really at a loss to know what else to try.

The very first error I see (on the login page, mind you) is:

Does disabling the themes fix the problem?

What are the first few errors shown on the users’ consoles?

Do any network requests (in the network tab) fail?

Is your site behind Cloudflare? Cloudflare causes problems.

Thank you! Disabling the themes gives this error:

Screenshot 2023-08-30 at 00.03.11

One network request failed:

https://forums.codexwriters.com/assets/discourse-e3f649566699cf8c4417bc3595cd3420859fcd938a38468f5da3380d92cd57fa.js

We are using Cloudflare, I thought just for DNS rather than as a CDN, but I’ll need to check with the other admin, who set that up.

This is essentially “the main application”, start here.

I just checked and you are behind Cloudflare.

Try toggling off the CDN proxying (click the orange cloud in the DNS settings and make it grey) and see if the problems go away.

Thank you! We cleared the cache and that seems to have solved the problem. (And I guess we need to do that after each upgrade.) If the issue recurs we’ll have to disable the CDN.

We specifically design Discourse to not require any cache busting, but it seems Cloudflare breaks this somehow.

If you need to keep CloudFlare on, disable as many features as you can.

In particular, Rocket Loader.

We don’t have any definitive guide, but this should help.