Installation fails on my Debian server

Hey, I’m no expert here but was able to install Discourse on a Droplet at Digital Ocean successfully yesterday. Can you share some more details of your setup (new host? Do you have other software on the server already? Did you read the 30-min install guide?).

I spent 2 hours installing Discourse because I failed to read the 30 min guide clearly.

Yeah of course I read the 30 minute install guide and follow everything thoroughly. Yes I have indeed some other software on the system. But you have to know that I’m no little hobbyist trying to have an exciting time trying out new software, but a software developer which has to provide his clients with a working and functioning system. I have a contract with a hosting company already, with special adapted prices, so switching companies is no option for me.
I disabled every webservice, even cleared out any left over nginx configuration and finally uninstalled nginx completely, so it can’t mess with discourse. I also don’t think there is any issue with existing configuration. Even when I provided discourse with the required files (already populated with configuration) it gave me the same error. I then cleaned everything thoroughly and tried to strictly follow the install guide. Still same error!

My server is a debian machine with full root access btw. So there shouldn’t be an issue there

You ran discourse-setup? Do you have at least 1gb of ram? You answered all the questions? Do you have dns configured? (if not, you need not configure let’s encrypt).

Yes I ran discourse-setup. I have well over 1gb of ram and answered all the questions. I redirect my domain through an a-record to the server. I have let’s encrypt certificates for all my domains under the default directory /etc/letsencrypt/live/ I even provided my email when prompted to input one for let’s encrypt. I also tried (before cleaning everything and trying to follow the 30-minute guide) to remove any entry from the templates, that contained a copy command as stated in the errror (cp /var/www/discourse/config/nginx.sample.conf). After I did that, it ran for approx. 3 minutes longer, but it then terminated again (I remember that there was some issue with copying some other files, but can’t remember exactly, as this was last week).

Up until this point I had no problem whatsoever with my server including my redirection through the a-record, as well as installing software, etc. It just behaves like a normal debian stretch, installed on my pc. Except for discourse somehow. Also I can’t imagine that a misconfiguration of some dns settings can prevent the discourse-setup to copy a simple file!

You mean that theA record points directly to your server’s public IP?

Oh. That sounds like at least a piece of the problem. If you have another web server running then you can’t follow the 30 minute install. It’s easiest if you install Discourse on its own server. If you want to install it with another web server, you’ll need to search here for instructions for setting it up with another web server.

And if you have some other web server in front, then you do not want to configure let’s encrypt in Discourse, as whatever other web server you have will be responsible for https.

1 Like
  1. Yes my a record points directly to my servers public ip
  2. You have misunderstood me, or rather I didn’t make myself very clear. There is no other webserver running at the moment. I backed everything up from apache and uninstalled nginx and apache completely. There is no webservice running at the moment, except of course the sshd service, which I need to do anything on the server at all. Also I tried that. I tried adding my certificates to a nginx config I placed under sites-available, but without success. I also tried to follow the tutorial under Running other websites on the same machine as Discourse, but to no success! It always fails at the copy step. I thought it would be some issue with the docker image, or something but I cloned the latest master branch!

Sorry. I’m that case, my only guess is that there is something wrong with the docker installation.

How did you install docker?

I have installed docker with apt, as I would try with nearly any package first…

The command sudo apt list --installed | grep -i docker produces the following output:

docker/stable,now 1.5-1+b1 amd64  [installiert]
docker-ce/stretch,now 5:18.09.3~3-0~debian-stretch amd64  [installiert]
docker-ce-cli/stretch,now 5:18.09.3~3-0~debian-stretch amd64  [Installiert,automatisch]
docker-compose/stable,now 1.8.0-2 all  [installiert]
python-docker/stable,now 1.9.0-1 all  [Installiert,automatisch]
python-dockerpty/stable,now 0.4.1-1 all  [Installiert,automatisch]

I’d recommend using as I think the install doc recommends. Apparently the Debian people and the docker people don’t get along and the default version is ancient.

1 Like

ok I’ll try. Does this script also install docker-compose? Or better, what versions should I uninstall? Also I figure you just have to do curl | sh right?

1 Like

I don’t think it includes docker compose. Strangely, the docker people think that they should include docker compose for windows (and maybe Mac? I haven’t paid attention or ever used docker compose partly because there isn’t any obvious way to get a current version).

Remove everything to do with docker and then run the curl pipe you included.

I installed the new docker version successfully (version 18.09.3) and cleaned everything from my previous attempts again and tried to follow the tutorial very thoroughly. Still getting the same error.

This is my console output. The error is at the very bottom (I removed personal information like for example the password)

(didn’t post the link)

Looks like the app.yml is broken. Can you share it here? (remove personal information)

Yeah I can do that. But I wonder why. I clone everything into /var/discourse and execute the build script. I’m not modifying the file at all! ([…] = personal information)

## this is the all-in-one, standalone Discourse Docker container template
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
## visit to validate this file as needed

  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see for details
  - "80:80"   # http
  - "443:443" # https

  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "256MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

  LANG: en_US.UTF-8

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example ','

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see for details

## The Docker container is stateless; all data is stored in /shared
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## Plugins go here
## see for details
    - exec:
        cd: $home/plugins
          - git clone

## Any custom commands to run after building
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email=''"
  - exec: echo "End of custom commands"

Nobody any idea on this topic? I would love to use discourse, but unfortunately there is this easy seeming issue! Also I have to say out of 3 apps I set up on my server, that use docker, none has worked without hours of bug fixing…

Is it time to re-image that machine to Ubuntu then?

1 Like

I think I’m doing just that…

1 Like

Should I use for docker again, or use the apt package?

Like I said above, install with | sh, not whatever comes with the OS.

You’ll be sorry if you use apt.

This would likely obviate your need to switch from Debian.