Installation fails on my Debian server

Undortunately I can’t get the basic discourse setup working. It always stops at the exact same point:

I, [2019-03-17T15:32:36.676696 #14]  INFO -- : > cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf
cp: cannot create regular file '/etc/nginx/conf.d/discourse.conf': No such file or directory
I, [2019-03-17T15:32:36.704154 #14]  INFO -- :
I, [2019-03-17T15:32:36.705628 #14]  INFO -- : Terminating async processes
I, [2019-03-17T15:32:36.706182 #14]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 69
I, [2019-03-17T15:32:36.706706 #14]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 185
2019-03-17 15:32:36.707 UTC [69] LOG:  received fast shutdown request
185:signal-handler (1552836756) Received SIGTERM scheduling shutdown...
185:M 17 Mar 2019 15:32:36.716 # User requested shutdown...
185:M 17 Mar 2019 15:32:36.716 * Saving the final RDB snapshot before exiting.
2019-03-17 15:32:36.751 UTC [69] LOG:  aborting any active transactions
185:M 17 Mar 2019 15:32:36.764 * DB saved on disk
185:M 17 Mar 2019 15:32:36.765 # Redis is now ready to exit, bye bye...
2019-03-17 15:32:36.777 UTC [69] LOG:  worker process: logical replication launcher (PID 78) exited with exit code 1
2019-03-17 15:32:36.778 UTC [73] LOG:  shutting down
2019-03-17 15:32:36.808 UTC [69] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf failed with return #<Process::Status: pid 298 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cmd"=>["cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf", "rm /etc/nginx/sites-enabled/default", "mkdir -p /var/nginx/cache"]}
196c92c63a4d6a2a50df35a987b2c8dc75a7c0cea6affc59b45dfe67b7065923
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

I have completely lost my mind trying to figure this out over the course of 5 hours but to no success. I hope somebody can help me with this!

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!

EDIT 1:
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/domain.name.com/.... 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).

EDIT 1:
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 get.docker.com 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 get.docker.com | 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.

https://paste.ee/p/t2rdh

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

EDIT 1:
(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
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed

templates:
  - "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 https://meta.discourse.org/t/17247 for details
expose:
  - "80:80"   # http
  - "443:443" # https

params:
  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

env:
  LANG: en_US.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  ## 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
  UNICORN_WORKERS: 4

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

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

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'info@dustvoice.de'

  ## 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_ADDRESS: [...]
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: [...]
  DISCOURSE_SMTP_PASSWORD: [...]
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  #LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

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

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

## Any custom commands to run after building
run:
  - 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='info@unconfigured.discourse.org'"
  - 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 get.docker.com for docker again, or use the apt package?