Blank pages every now and then


(Jo0Lz) #1

Hey all. I’ve been running Discourse for a small community for a few weeks now, and I must say, it’s brilliant.
I’ve experienced something wierd. Every now and then, the browser page remains white. Refreshing several times doesn’t help, it seems the page will remain white for a few seconds, no matter how many times you refresh. Then, all of a sudden it’s all back to normal.

I’ve checked the error logs, and I see these kinds of errors:

1:

Info:

TypeError: undefined is not an object (evaluating 'Discourse.Dialect.addPreProcessor')
Url: https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js
Line: 1
Column: 20237
Window Location: https://discuss.stinkboeven.nl/

Backtrace:

https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js:1:20237
global code@https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js:1:20442

Environment:

hostname	stinkboeven-app
process_id	[131, 150]
application_version	c42354420897fbc32ce605257d6ea4b1d0f64a9b
HTTP_HOST	discuss.stinkboeven.nl
REQUEST_URI	/logs/report_js_error
REQUEST_METHOD	POST
HTTP_USER_AGENT	Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1
HTTP_ACCEPT	*/*
HTTP_REFERER	https://discuss.stinkboeven.nl/
HTTP_X_FORWARDED_FOR	[x.x.x.x, unix:, x.x.x.x, unix:]
HTTP_X_REAL_IP	unix:
params	
message	TypeError: undefined is not an object (evaluating 'Discourse.Dialect.addPreProcessor') Url: https://d
url	https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925
line	1
column	20237
window_location	https://discuss.stinkboeven.nl/
stacktrace	https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925

2:

Info:

Uncaught TypeError: Cannot read property 'addPreProcessor' of undefined
Url: https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js
Line: 1
Column: 20237
Window Location: https://discuss.stinkboeven.nl/latest

Backtrace:

TypeError: Cannot read property 'addPreProcessor' of undefined
    at https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js:1:20237
    at https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925d42c2b6f.js:1:20442

Environment:

hostname	stinkboeven-app
process_id	[131, 150]
application_version	c42354420897fbc32ce605257d6ea4b1d0f64a9b
HTTP_HOST	discuss.stinkboeven.nl
REQUEST_URI	/logs/report_js_error
REQUEST_METHOD	POST
HTTP_USER_AGENT	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
HTTP_ACCEPT	*/*
HTTP_REFERER	https://discuss.stinkboeven.nl/latest
HTTP_X_FORWARDED_FOR	x.x.x.x, unix:
HTTP_X_REAL_IP	unix:
params	
message	Uncaught TypeError: Cannot read property 'addPreProcessor' of undefined Url: https://discuss.stinkboe
url	https://discuss.stinkboeven.nl/assets/plugin-f4e50299ba6371f74c7807756f77190eb8dd4cab2ccbd65d1732c925
line	1
column	20237
window_location	https://discuss.stinkboeven.nl/latest
stacktrace	TypeError: Cannot read property 'addPreProcessor' of undefined at https://discuss.stinkboeven.nl/

I’ve checked, I’m up to date, and it’s been happening ever since I first set up the Discourse. I have the feeling it happens on first load for returning visitors; I can reproduce the error easier when loading the page when not logged in, but could also just be a coincidence. I had some warnings about swap when rebuilding, I have since addressed them, so that should be fine. Anything in particular I should look into? I’m kind of at a loss as to where I should begin troubleshooting :smiley:
Any help is appreciated.


(cpradio) #2

What plugins do you have installed and are they up-to-date?


(Jo0Lz) #3

The following plugins are installed:

discourse-details						Up to date
Konami (5cbc7fa)						Up to date
discourse-nginx-performance-report		Up to date
discourse-push-notifications (3b78dee)	Up to date
discourse-solved (e63c17b)				Up to date
Spoiler Alert! (c7e4c68)				Up to date
docker_manager (97c3b03)				Up to date
lazyYT									Up to date
poll									Up to date

Konami was just for fun, I can de-activate that one. Problem is, the same error occured on march 8th, at that time I didn’t have any additional plugins installed.
“Discourse.Dialect.addPreProcessor” is referred. But I don’t know what it is :smiley:


(cpradio) #4

Yeah, it definitely isn’t Konami. It seems to be coming from the Spoiler Alert! plugin, but I don’t know why, as it shouldn’t be executing that code at all…


(Jo0Lz) #5

I can try to disable plug-ins to see if the issue still arises, but I’m wondering what the steps are to troubleshoot. I’ve reviewed the log files, but this information is not making things clearer :smiley:


(Mittineague) #6

If you haven’t tried it yet, I think safe-mode should help you to narrow things down a bit.


(Jo0Lz) #7

Woah, great tip. Tried refreshing the page a lot and it all seemed fine. Hit CTRL+F5 a few times in incognito mode, and bam:

Info:

Uncaught TypeError: Discourse.start is not a function
Url: https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official
Line: 198
Column: 15
Window Location: https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official

Backtrace:

TypeError: Discourse.start is not a function
    at https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official:198:15
    at https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official:203:5

Environment

hostname	stinkboeven-app
process_id	131
application_version	c42354420897fbc32ce605257d6ea4b1d0f64a9b
HTTP_HOST	discuss.stinkboeven.nl
REQUEST_URI	/logs/report_js_error
REQUEST_METHOD	POST
HTTP_USER_AGENT	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
HTTP_ACCEPT	*/*
HTTP_REFERER	https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official
HTTP_X_FORWARDED_FOR	x.x.x.x, unix:
HTTP_X_REAL_IP	unix:
params	
message	Uncaught TypeError: Discourse.start is not a function Url: https://discuss.stinkboeven.nl/?safe_mode=
url	https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official
line	198
column	15
window_location	https://discuss.stinkboeven.nl/?safe_mode=no_custom%2Cno_plugins%2Conly_official
stacktrace	TypeError: Discourse.start is not a function at https://discuss.stinkboeven.nl/?safe_mode=no_cust

So even with default, the white page issue is there. :flushed:


(cpradio) #8

What if you leave all 3 checkboxes checked so it doesn’t load official plugins either?


(Sam Saffron) #9

Keep your dev tools open, when that happens is it failing to download some of the assets, sounds to me like you are having issues serving assets occasionally


(Jo0Lz) #10

Bingo. Don’t know why I didn’t think of that…

The only question now is, how do I find out why it is happening and fix it :smiley:

Edit:
The same thing occasionally happens when I upload an image; it won’t show until after a refresh of the page. I’m running Nginx as front end proxy; I’ll see if I can find anything in the log files.

Edit 2:
It seems to happen a lot more to users that aren’t logged in. I can reproduce the error fine when using incognito mode and refreshing a bunch of times, logged in it doesn’t really seem to happen. Have seen it once or twice on mobile, but can’t recall if I was logged in or not at the time…


(Sam Saffron) #11

Can you do a rebuild?

If that fails, maybe try to rebuild with brotli disabled, by setting COMPRESS_BROTLI to 0 in env?


(Jo0Lz) #12

It’s rebuilding now. (And showing @fefrei’s error page :D)
I’ll check the build log for any warnings I might have missed as well.


(Sam Saffron) #13

This sounds very fishy to me, how is the traffic configured? Is all traffic going through an extra NGINX?


(Jo0Lz) #14

Well, there is a “landing page” on the main domain, served through the original NGINX install that hosted another website before. This configuration is also used to serve some light php websites on a subdomain.

The nginx is forwarding traffic for the discourse subdomain through the http.socket; acting as proxy. The configuration in this topic https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/ was used.

I see now, that his is causing issues on the nginx install in front of the discourse docker. I’m currently reading some additional documentation, wirtten by you Sam :), should be able to clear things up by changing the configuration.

Edit: So, this isn’t really about Discourse, or the Docker install… Sorry, thanks for the assistance!


(Sam Saffron) #15

Yeah your proxy is causing the issues, I would eliminate it or replace it with an nginx proxy that is the exact same nginx that discourse docker installs (which would be very tricky)


(Jo0Lz) #16

Yeah, as I was reading some documentation and checking the current configuration, I discovered a discrepancy in the user that was running processes. I’ve checked the error logs, and the consistent error was upstream error, but it would follow after permission errors on cache directories…

So, after a good night sleep, I’ve just corrected the cache folder permissions, and cleared the logs. The issue seems to be solved now, with the proxy nginx still in place. I am still looking at an alternative setup, but for now this will do.

Thanks for the assistance, greatly appreciated!