Discourse Preview Not Working

(Shukazé) #1

Discourse Version: 1.9.0.beta5

I’ve ran into a particular problem with the preview, it doesn’t show content on any browser since I’ve updated it from ~1.7

I don’t know what’s wrong, have I missed something that I needed to do?

(Joffrey Jaffeux) #2

Could hou try to use safe mode and see if it works without plugins How to use Discourse Safe Mode

(Shukazé) #3

Here’s a screenshot when in safemode:

(Joffrey Jaffeux) #4

Then watch your logs/browser console for any error.

(Shukazé) #5

I’ve got the latest log that dates back to the 21st of July 2017 which reads:

TypeError: Cannot read property ‘create’ of undefined
at https://forum.fmisgaming.com/assets/vendor-199fce5a9e9895329b51b04605f1f5061951acb488baa6b2ea2fc2ae36def529.js:6:31982
at https://forum.fmisgaming.com/assets/vendor-199fce5a9e9895329b51b04605f1f5061951acb488baa6b2ea2fc2ae36def529.js:7:994

(Shukazé) #6

I’m just gonna backup and nuke it all and reinstall it. Hopefully this will fix it.

(Shukazé) #7

I’ve nuked it and all and it still doesn’t work. Please tell me specific commands or urls to provide more information for you, I am really stumped right now.

What I did:

Is it really the swap? Mines set to 255MB and it’s recommended for 2048MB, my docker info is:

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 4
Server Version: 17.05.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 26
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.873GiB
Name: [Redacted]
ID: [Redacted]
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

Will proceed with steps provided: https://meta.discourse.org/t/how-to-install-docker-with-aufs-on-linode/39831

Let’s see how this goes.

Welp, I already had all this set besides the swap size, preview still doesn’t work. Ideas @joffreyjaffeux ?

(Jeff Atwood) #8

Do you have any third-party plugins installed? They are notorious for causing breakage on upgrade. Remove any third-party plugins you have installed.

(Shukazé) #9

If you mean by third party plugins via app,yml then I removed everything but the defaults. Is this maybe a docker or redis issue?

…what I mean by defaults is that it’s empty.

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
    - exec:
        cd: $home/plugins
          - git clone https://github.com/discourse/docker_manager.git

(Sam Saffron) #10

Wait a sec, what web browser are you using? Does this happen here?


@sam I have tried this both on Firefox and Chrome and it doesn’t work, but while I’m writing this, it works so it should not be browser-based issue


I experience the same issue in the latest Version: 1.9.0.beta7

(Jeff Atwood) #13

Unless it also happens here and/or on https://try.discourse.org, this is a configuration error with your Discourse.


Your comment actually brought me to the solution.

Here is the thing: I moved discourse to a new server. Made a backup of the old discourse, setup a new instance on the new server and imported the old backup. So i was sure it was no setting error.
But thanks to your answer i checked the old server/discourse instance and got the same ‘issue’ somewhere it loads an insecure script.


it seems this script is loaded via http but https http://forum.xxx.tld/assets/markdown-it-bundle-95eab67cdea904c1edf468e5ed93ba3d0ed27da63e4428828e8a566506f74391.js

(sorry for the german) it is the browser that stopped a skript from not authenticated source. Not sure why this happens cause i got SSL installed just not enforced since this hadn’t worked in the past and everything was fine
All sites are loaded as https and it got everywhere the green lock.


Update: I have now ‘force ssl’ enabeled still it loads the script via http

Q. is there any .htaccess equivalent for discourse? to rout all request to that url to https?


@codinghorror is there an option to set https for scripts manually. Like gradually enforcing it not like black and white how it is now.


Might relate to this issue: [Solved] Dev instance with nginx: topic preview not working


unfortunately not.
i believe the apache proxy setup i have does not work for this. Somehow everything works fine as long as i don’t force https.
If i do i end up with and too many redirects because of the SSO provider.

Shame one can not enforce https gradually. only with base url change i would do it. cause script is reachable through https but discourse seems not to get it

(xiasummer) #19

Hi, I’m using the newest Discourse 1.9.0 beta7

Any idea why this happens?

Discourse assign
(Joshua Rosenfeld) #20

Hmm @sam here’s another report…