A discussion about a bug involving missing Brotli assets after site upgrades, particularly when using the web interface. Users pfaffman and codinghorror report that rebuilding via the web interface leads to missing JavaScript assets (e.g., en-2767e8d4317a5d4ca60e61187a74d85225d46c78928d59aacab8b5df54a4ad8b.js), causing site inaccessibility, while rebuilding from the command line resolves the issue. Falco questions whether the CDN is at fault, but pfaffman confirms the files are missing both on the CDN and the server, indicating a problem with asset generation. sam identifies the root cause: a misnamed COMPRESS_BROTLI environment variable that was lost during web upgrades, combined with a broken fallback to non-Brotli assets. The issue was fixed by backporting changes to stable and beta, making Brotli unconditionally enabled, as it had been effectively on by default for years. supermathie advises checking the container and Discourse versions for context.
I did a rebuild yesterday which seemed to have fixed it, but it’s happening still.
It’s particularly pernicious because without these assets the site is inaccessible and my normal test of pulling the site and looking for “Discourse” implies that the site is just fine (this is a separate issue, however).
Oh, and it’s not the CDN’s fault, as the file isn’t on the server when accessed directly.
I just did another rake assets:precompile and that didn’t fix it either.
EDIT: I rebuilt again and everything is fine, but I swear this is exactly what happened about 20 hours ago.
So just a while ago I rebuilt and everything was fine and now some resources are again missing.
They seem to be different ones than before.
I’m changing this to a bug.
I’m disabling the babble plugin. Retort and whosonline are still installed, but are working just fine on another site. This doesn’t seem like it’d be affected by the plugin. . .
The rebuild again has everything working, but twice before things were working after a rebuild and then some js resources went missing (or something went looking for the wrong ones).
I checked this, but tried both using the hostname directly to bypass the CDN and also doing a find /var/www/discourse -name missing-filename (I’m 90% sure I did that inside thecontainer and not just in /var/discourse/shared, or maybe I did find /shared inside the container).
I am continually annoyed by people who don’t share URLs when they are essential for troubleshooting the problem. And now I’m doing it.
No. That was my first assumption as well, bu it doesn’t seem to be the CDN’s fault. When the file is missing from the CDN is it also missing from the host. It seems that Discourse is linking to files that don’t exist. I included the CDN/non-CDN pair to convince myself that I know how to generate the local server URL from the CDN url.
Does something clean up those assets that might be deleting them when it shouldn’t?
I’ve seen this on two sites that I tried to rebuild today, rebuilding from the web updater fails per the pic .. but rebuilding from command line works OK:
I can confirm that thebitcoin.pub gets links to missing assets when an upgrade is done from the web interface and rebuild from the command line fixes it.
What I can’t tell is if this is limited to this site and @codinghorror’s two or if it’s all of them. It seems like it it were the latter, there would be a bigger outcry, especially with two beta releases in less than a week.
Jeff you don’t have any plugins that could be to blame, do you? This site has who’s online and retort.
This happened to me again last night with both commonmark and my own site. Web rebuild resulted in white page with weird 404s from CDN. Rebuilding from command line fixed it.
The root of the problem is that we carried around a strangely named COMPRESS_BROTLI env var to denote we should use brotli compression. This var got eaten by the web upgrader.
I think (not sure) when @david refactored some of the way we do brotli assets our path that used to fallback to non brotli assets stopped doing so.
Anyway… having these two things are a problem:
An oddly named global setting
Brotli even be optional
So now… brotli is unconditionally enabled everywhere including stable and beta.
Keep in mind for about 2-3 years brotli has been “optional default on” and nobody ever really turned it off.