Blank pages, 500 errors and no logs

So while trying to get a portable/automated Docker deployment up I’m spinning up my old system-installed Discourse instance temporarily but I’ve hit some issues and it won’t work properly again (it did for a long time before I switched to using Traefik a few months ago - because Discourse was using a unix:// socket which didn’t make sense in the context of a Traefik container and didn’t know I could switch Discourse to use ports instead.

Anyway, I dug through the forum and discovered I can use

expose:
  - "3000"
  - "2222"

And I also added labels for Traefik:


labels:
  traefik.frontend.rule: "Host:forum.southcla.ws"
  traefik.docker.network: "gateway"
  traefik.port: "3000"

And those are working great, Traefik can now talk to my Discourse container!

But, when I loaded up the page, it was pure white and the console contained a ton of 404s. Very strange, because it worked fine literally 3 days earlier when I shut off Traefik and accessed it via Caddy (a reverse proxy from domain.com -> unix://xyz).

So I’m not really sure how just changing the network interface method caused this - couldn’t find anything else in the docs or on the forum.

I poked around the forum, found a thread that mentioned using stable instead of testspassed so I tried that, now I just get a 500 error instead of a blank page.


On both of these tests, the logs output the same thing:

rsyslogd: command 'KLogPermitNonKernelFacility' is currently not permitted - did you already set it via a RainerScript command (v6+ config)? [v8.16.0 try http://www.rsyslog.com/e/2222 ]
rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
rsyslogd: activation of module imklog failed [v8.16.0 try http://www.rsyslog.com/e/2145 ]
rsyslogd: Could not open output pipe '/dev/xconsole':: No such file or directory [v8.16.0 try http://www.rsyslog.com/e/2039 ]
supervisor pid: 41 unicorn pid: 82

Which I have no idea what it means! I assumed the container should Just Work™ because that’s the problem that docker is meant to solve but it seems I’m getting different results after just a couple of days and one config change.

I would change back but that means turning off Traefik and shutting down every other web service I’m hosting - I basically need to run Discourse on a port, not a unix:// socket.

Would love to get my forum back online after months of downtime, aside from all these issues, Discourse is by far my favourite forum software available, thanks!

Wherever you found that, that’s bad advice.

1 Like

Alright, I’ll stay on the latest then. Thanks for letting me know!

Still, the issues are persisting, blank pages and 404s, no idea how to fix this one.

Well, either your reverse proxy isn’t configured correctly or a plugin broke your Discourse. You could take a look at How to use Discourse Safe Mode in order to rule out plugin problems.

The proxy is running for 24 other containers and they all work fine - are there any specific settings that Discourse requires, like special headers or anything like that?

Safe mode won’t work, exact same issue with the blank screen and 404s trying to load .js files.

There’s a nginx server running on port 80 inside the container. Your reverse proxy would have to do all the stuff nginx is doing since you are connecting to port 3000. I don’t recommend doing that. There’s too much that can go wrong and you are experiencing that right now.

My recommendation:

  1. Read Running other websites on the same machine as Discourse

  2. Expose the container’s nginx on a different port by editing your app.yml. E.g.:

    expose:
      - "8080:80"   # http
    
  3. Configure your reverse proxy to connect to the container via the port exposed in app.yml (e.g. 8080) and make sure your reverse proxy sends the required headers. See Running other websites on the same machine as Discourse for more information on that.

2 Likes

Ah, okay, I didn’t know there was another reverse proxy running inside the container, that’s kinda weird in the docker world!

Thanks, I’ll give this a try and look into headers - afaik Traefik just passes all headers with no changes.

Edit: Yep, that worked, thanks!

2 Likes