Blank page because of header locale selector

AI-generated summary

A user, joshhabka, reports a blank page issue on their Discourse site, accompanied by errors in the logs related to MaxMindDB files and JavaScript errors. They share console logs and a video recording demonstrating the problem. nat suggests that the issue might be related to customizations rather than MaxMindDB. Moin identifies the header locale selector plugin as the likely culprit, pointing to a JSON parsing issue in the plugin’s code. joshhabka confirms that disabling the plugin resolves the issue and notes that the plugin appears to be unmaintained. They plan to report the issue in the plugin’s thread.

Here is what is shows in /logs:

Discourse AI: Errors during bulk classification: Failed to classify 98 posts (example ids: 1859, 1860, 2012, 1976, 1977) : ArgumentError : address cannot be nil or empty 9:06 pm 137  MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb 9:06 pm 137  MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb 9:06 pm 5  MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb 9:07 pm 5  MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb

Console Logs:

[Error] Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' does not appear in the style-src directive of the Content Security Policy. (inner.html, line 1)
[Error] TypeError: null is not an object (evaluating 'styleElement.sheet.insertRule')
	handleMessage (advanced-script.js:262)
[Error] SyntaxError: JSON Parse error: Unexpected identifier "object"
	parse (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	eM (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20358)
	X (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:355:239649)
	T (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20337)
	eU (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:35846)
	create (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:37443)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:39997)
	evaluate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:27332)
	evaluateSyscall (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:73408)
	evaluateInner (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72970)
	evaluateOuter (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72889)
	next (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83857)
	_execute (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83720)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:60814)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64461)
	tA (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:68244)
	_renderRoots (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64361)
	_renderRootsTransaction (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64748)
	_revalidate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:65226)
	invoke (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5027)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:4111)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5987)
	_end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11037)
	end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:8163)
	_run (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11549)
[Error] SyntaxError: JSON Parse error: Unexpected identifier "object"
	parse (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	eM (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20358)
	X (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:355:239649)
	T (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20337)
	eU (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:35846)
	create (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:37443)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:39997)
	evaluate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:27332)
	evaluateSyscall (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:73408)
	evaluateInner (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72970)
	evaluateOuter (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72889)
	next (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83857)
	_execute (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83720)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:60814)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64461)
	tA (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:68244)
	_renderRoots (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64361)
	_renderRootsTransaction (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64748)
	_revalidate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:65226)
	invoke (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5027)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:4111)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5987)
	_end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11037)
	end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:8163)
	_run (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11549)
[Error] Failed to load resource: the server responded with a status of 404 () (discourse-solved-b31fb508.map, line 0)
[Error] SyntaxError: JSON Parse error: Unexpected identifier "object"
	parse (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	eM (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:409:36730)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20358)
	X (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:355:239649)
	T (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:91:20337)
	eU (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:35846)
	create (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:37443)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:39997)
	evaluate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:27332)
	evaluateSyscall (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:73408)
	evaluateInner (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72970)
	evaluateOuter (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:72889)
	next (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83857)
	_execute (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:83720)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:60814)
	(anonymous function) (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64461)
	tA (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:68244)
	_renderRoots (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64361)
	_renderRootsTransaction (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:64748)
	_revalidate (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:72:65226)
	invoke (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5027)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:4111)
	flush (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:5987)
	_end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11037)
	end (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:8163)
	_run (chunk.4e4f0fd5728c3ad657f3.d41d8cd9.br.js:314:11549)

This is a video recording of what it shows when going to the website, safe mode does work.

Hey there, I don’t think it’s related to MaxMindDB.

It looks like it could be one of your customizations as the app ‘loaded’ and I can see the navbar. Have you considered turning them off one-by-one first?

I think the problem is the header locale selector.

@nat that’s what I meant with JSON.parse suddenly breaking the site.

Yep! This was it - I will mention this issue in the plugin thread so they can look into it.

Thank you :slight_smile:

It also seems unmaintained which is never good