Error while trying to install Discourse


(Temmyhlee) #1

Hello, I have been trying to install discourse on my development server but it isn’t working and I have increased the Ram to 4gb. Can anyone please help me with it?

The error is attached…

156:M 26 Dec 10:09:29.206 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
156:M 26 Dec 10:09:29.206 # Server started, Redis version 3.0.6
156:M 26 Dec 10:09:29.206 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
156:M 26 Dec 10:09:29.206 * DB loaded from disk: 0.000 seconds
156:M 26 Dec 10:09:29.207 * The server is now ready to accept connections on port 6379
I, [2017-12-26T10:09:39.203096 #14]  INFO -- : 
I, [2017-12-26T10:09:39.203900 #14]  INFO -- : Replacing <policymap> with <policymap>
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
  <policy domain="coder" rights="none" pattern="MVG" />
  <policy domain="coder" rights="none" pattern="MSL" />
  <policy domain="coder" rights="none" pattern="TEXT" />
  <policy domain="coder" rights="none" pattern="SHOW" />
  <policy domain="coder" rights="none" pattern="WIN" />
  <policy domain="coder" rights="none" pattern="PLT" />
 in /usr/local/etc/ImageMagick-6/policy.xml
I, [2017-12-26T10:09:39.208514 #14]  INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
I, [2017-12-26T10:09:39.299555 #14]  INFO -- : 
I, [2017-12-26T10:09:39.300016 #14]  INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
I, [2017-12-26T10:09:39.407569 #14]  INFO -- : 
I, [2017-12-26T10:09:39.408087 #14]  INFO -- : > chown -R discourse /home/discourse
I, [2017-12-26T10:09:39.415458 #14]  INFO -- : 
I, [2017-12-26T10:09:39.415856 #14]  INFO -- : > rm -f /etc/cron.d/anacron
I, [2017-12-26T10:09:39.420168 #14]  INFO -- : 
I, [2017-12-26T10:09:39.426503 #14]  INFO -- : File > /etc/cron.d/anacron  chmod: 
I, [2017-12-26T10:09:39.439677 #14]  INFO -- : File > /etc/runit/1.d/copy-env  chmod: +x
I, [2017-12-26T10:09:39.447354 #14]  INFO -- : File > /etc/runit/1.d/enable-brotli  chmod: +x
I, [2017-12-26T10:09:39.452459 #14]  INFO -- : File > /etc/service/unicorn/run  chmod: +x
I, [2017-12-26T10:09:39.459152 #14]  INFO -- : File > /etc/service/nginx/run  chmod: +x
I, [2017-12-26T10:09:39.464931 #14]  INFO -- : File > /etc/runit/3.d/01-nginx  chmod: +x
I, [2017-12-26T10:09:39.473536 #14]  INFO -- : File > /etc/runit/3.d/02-unicorn  chmod: +x
I, [2017-12-26T10:09:39.473732 #14]  INFO -- : Replacing # postgres with sv start postgres || exit 1 in /etc/service/unicorn/run
I, [2017-12-26T10:09:39.474233 #14]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2017-12-26T10:09:39.477123 #14]  INFO -- : > cd /var/www/discourse && git reset --hard
182:M 26 Dec 10:09:39.487 # Creating Server TCP listening socket *:6379: bind: Address already in use
Checking out files: 100% (24719/24719), done.
I, [2017-12-26T10:09:43.792385 #14]  INFO -- : HEAD is now at f5d45f7 Fix broken Gemfile.lock.

I, [2017-12-26T10:09:43.799016 #14]  INFO -- : > cd /var/www/discourse && git clean -f
I, [2017-12-26T10:09:43.991284 #14]  INFO -- : 
I, [2017-12-26T10:09:43.991431 #14]  INFO -- : > cd /var/www/discourse && git remote set-branches --add origin master
I, [2017-12-26T10:09:43.998305 #14]  INFO -- : 
I, [2017-12-26T10:09:43.998430 #14]  INFO -- : > cd /var/www/discourse && git pull
From https://github.com/discourse/discourse
   f5d45f7..f6dc992  master     -> origin/master
   0c40e2d..63d48a0  beta       -> origin/beta
 * [new branch]      fix-rtl-caret-position -> origin/fix-rtl-caret-position
 * [new branch]      flag-history -> origin/flag-history
   f18f608..c45964b  stable     -> origin/stable
   f5d45f7..f6dc992  tests-passed -> origin/tests-passed
 * [new branch]      typography-2.0 -> origin/typography-2.0
 * [new tag]         v1.8.11    -> v1.8.11
 * [new tag]         v1.9.0.beta16 -> v1.9.0.beta16
 * [new tag]         v1.9.0.beta17 -> v1.9.0.beta17

I, [2017-12-26T10:09:50.926178 #14]  INFO -- : > cd /var/www/discourse && git fetch origin tests-passed
From https://github.com/discourse/discourse
 * branch            tests-passed -> FETCH_HEAD
I, [2017-12-26T10:09:52.962530 #14]  INFO -- : 
I, [2017-12-26T10:09:52.963089 #14]  INFO -- : > cd /var/www/discourse && git checkout tests-passed
Switched to a new branch 'tests-passed'
I, [2017-12-26T10:09:53.517419 #14]  INFO -- : Branch tests-passed set up to track remote branch tests-passed from origin.

I, [2017-12-26T10:09:53.517703 #14]  INFO -- : > cd /var/www/discourse && mkdir -p tmp/pids
I, [2017-12-26T10:09:53.528324 #14]  INFO -- : 
I, [2017-12-26T10:09:53.528477 #14]  INFO -- : > cd /var/www/discourse && mkdir -p tmp/sockets
I, [2017-12-26T10:09:53.532264 #14]  INFO -- : 
I, [2017-12-26T10:09:53.532518 #14]  INFO -- : > cd /var/www/discourse && touch tmp/.gitkeep
I, [2017-12-26T10:09:53.539192 #14]  INFO -- : 
I, [2017-12-26T10:09:53.539339 #14]  INFO -- : > cd /var/www/discourse && mkdir -p                    /shared/log/rails
I, [2017-12-26T10:09:53.542742 #14]  INFO -- : 
I, [2017-12-26T10:09:53.542895 #14]  INFO -- : > cd /var/www/discourse && bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log"
I, [2017-12-26T10:09:53.549877 #14]  INFO -- : 
I, [2017-12-26T10:09:53.550020 #14]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log /var/www/discourse/log"
I, [2017-12-26T10:09:53.555500 #14]  INFO -- : 
I, [2017-12-26T10:09:53.555687 #14]  INFO -- : > cd /var/www/discourse && bash -c "mkdir -p           /shared/{uploads,backups}"
I, [2017-12-26T10:09:53.561742 #14]  INFO -- : 
I, [2017-12-26T10:09:53.561930 #14]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/{uploads,backups} /var/www/discourse/public"
I, [2017-12-26T10:09:53.566403 #14]  INFO -- : 
I, [2017-12-26T10:09:53.566558 #14]  INFO -- : > cd /var/www/discourse && chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups
I, [2017-12-26T10:09:53.572691 #14]  INFO -- : 
I, [2017-12-26T10:09:53.573494 #14]  INFO -- : Replacing # redis with sv start redis || exit 1 in /etc/service/unicorn/run
I, [2017-12-26T10:09:53.573971 #14]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/docker_manager.git
Cloning into 'docker_manager'...
I, [2017-12-26T10:09:56.407615 #14]  INFO -- : 
I, [2017-12-26T10:09:56.408185 #14]  INFO -- : > cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf
I, [2017-12-26T10:09:56.421523 #14]  INFO -- : 
I, [2017-12-26T10:09:56.421915 #14]  INFO -- : > rm /etc/nginx/sites-enabled/default
I, [2017-12-26T10:09:56.423923 #14]  INFO -- : 
I, [2017-12-26T10:09:56.424202 #14]  INFO -- : > mkdir -p /var/nginx/cache
I, [2017-12-26T10:09:56.430587 #14]  INFO -- : 
I, [2017-12-26T10:09:56.431079 #14]  INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2017-12-26T10:09:56.431670 #14]  INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2017-12-26T10:09:56.432181 #14]  INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2017-12-26T10:09:56.434674 #14]  INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2017-12-26T10:09:56.435337 #14]  INFO -- : > echo "done configuring web"
I, [2017-12-26T10:09:56.443653 #14]  INFO -- : done configuring web

I, [2017-12-26T10:09:56.444358 #14]  INFO -- : > cd /var/www/discourse && gem update bundler
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    timed out (https://api.rubygems.org/specs.4.8.gz)
I, [2017-12-26T10:10:57.380501 #14]  INFO -- : Updating installed gems

I, [2017-12-26T10:10:57.381450 #14]  INFO -- : Terminating async processes
I, [2017-12-26T10:10:57.381620 #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/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 43
156:signal-handler (1514283057) Received SIGTERM scheduling shutdown...
I, [2017-12-26T10:10:57.381888 #14]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 156
2017-12-26 10:10:57.382 UTC [43] LOG:  received fast shutdown request
2017-12-26 10:10:57.382 UTC [43] LOG:  aborting any active transactions
2017-12-26 10:10:57.382 UTC [50] LOG:  autovacuum launcher shutting down
2017-12-26 10:10:57.390 UTC [47] LOG:  shutting down
2017-12-26 10:10:57.418 UTC [47] LOG:  database system is shut down
156:M 26 Dec 10:10:57.448 # User requested shutdown...
156:M 26 Dec 10:10:57.448 * Saving the final RDB snapshot before exiting.
156:M 26 Dec 10:10:57.453 * DB saved on disk
156:M 26 Dec 10:10:57.453 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 269 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "chown -R discourse $home"]}
7afdb54da45a197c6b8d3fab0383c321c4aa088144118bdfd9419b6efa4ce142
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

real	1m53.998s
user	0m1.040s
sys	0m0.472s

Also when I run free -h I get this:

              total           used        free            shared   buff/cache   available

Mem: 3.9G 108M 799M 5.6M 3.0G 3.4G
Swap: 0B 0B 0B


(Andrew Schleifer) #2

Memory is not your problem, DNS is. The install failed because your server could not locate the rubygems server to download modules.

  • Does this error appear every time you run the installer?
  • What does the command host api.rubygems.org return?
  • What DNS is your server using?

(Temmyhlee) #3

Yes it does,

api.rubygems.org is an alias for rubygems.org.
rubygems.org has address 151.101.66.2
rubygems.org has address 151.101.194.2
rubygems.org has address 151.101.2.2
rubygems.org has address 151.101.130.2
rubygems.org mail is handled by 10 mxa.mailgun.org.
rubygems.org mail is handled by 10 mxb.mailgun.org.

(Andrew Schleifer) #4

You missed a question.

The host command gives reasonable output; You probably ran that outside the container. Are the same DNS servers configured inside?


(Temmyhlee) #5

I am connecting to the server using IP address… I just mapped the subdomain to the ip address. But on the domain example.com (which has discourse too btw uses DO nameserver).
But i want to install it on another server that has just IP address but mapped to forum.example.com.


(Andrew Schleifer) #6

Run cd /var/www/discourse && gem update bundler. What does that output?


(Temmyhlee) #7

The directory you typed is /var/www/discourse and when I typed this, I got bash: cd: /var/www/discourse: No such file or directory.

When I ran cd /var/discourse &amp;&amp; gem update bundler I got this :arrow_down:

The program 'gem' is currently not installed. You can install it by typing: apt install ruby


(Andrew Schleifer) #8

Sorry, I should’ve been more clear. That was meant to be run inside the container.

Does docker ps show any running containers? Does docker images show the local_discourse/app image or just discourse/base?

If the answer to both is no, then removing /var/discourse and starting over might be easier then troubleshooting why.

This is a different DO droplet to the working one, right? Is this droplet in the same DO regions as the working one? Do they have the same contents in /etc/resolv.conf?