# Discourse has stopped opening

**URL:** https://meta.discourse.org/t/discourse-has-stopped-opening/47710
**Category:** Self-hosting
**Created:** [July 24, 2016, 11:38am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710 "2016-07-24T11:38:31Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 24, 2016, 11:38am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/1 "2016-07-24T11:38:31Z")

</div>

Hi dears,  
unfortunately, my website [http://specknz.me/](http://specknz.me/) has stopped opening and I don’t really know what has caused it. Also I’ve got an error:

```
502 Bad Gateway
nginx

```

How could be it sort out without touching the Snapshot on the Digitalocean?  
Thank you.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 24, 2016, 3:49pm UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/2 "2016-07-24T15:49:49Z")

</div>

SSH inside and do the tree magic phrases:

```plaintext
cd /var/discourse
git pull
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 25, 2016, 2:59am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/3 "2016-07-25T02:59:40Z")

</div>

Thanks Rafael, I’ve already rebuilded the app, but it still doesn’t work.

…

```
Removing old container
+ /usr/bin/docker rm app
app

+ /usr/bin/docker run -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=3 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e DISCOURSE_HOSTNAME=speckme.nz -e DISCOURSE_DEVELOPER_EMAILS=tamerlanium@gmail.com -e DISCOURSE_SMTP_ADDRESS=smtp.gmail.com -h discourse-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 25654:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:f9:8c:dd:3d:63 local_discourse/app /sbin/boot
357203ee7df50c1e85272786c05d1826f773412b6706ad3f9d6de262eb148119
root@discourse:/var/discourse# reboot

Broadcast message from itamerlanium@discourse
	(/dev/pts/0) at 18:51 ...

The system is going down for reboot NOW!
root@discourse:/var/discourse# Connection to 159.203.205.195 closed by remote host.
Connection to 159.203.205.195 closed.

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 25, 2016, 3:09am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/4 "2016-07-25T03:09:46Z")

</div>

I didn’t understood the log, why the reboot after the rebuild?

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 25, 2016, 8:19am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/5 "2016-07-25T08:19:05Z")

</div>

I tried to open the website before and after the reboot, anyway it doesn’t work.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 25, 2016, 1:18pm UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/6 "2016-07-25T13:18:58Z")

</div>

Please tail the logs. My bet is a wrong permission so start by tailing nginx log.

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 26, 2016, 2:27am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/7 "2016-07-26T02:27:59Z")

</div>

Unfortunately the access.log is empty. I found some logs through the error files.

```
access.log error.log.1 error.log.3.gz
error.log error.log.2.gz error.log.4.gz
root@discourse:/var/log/nginx#

 GNU nano 2.2.6 File: error.log.1

2016/07/19 00:22:26 [emerg] 1536#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/19 17:31:32 [emerg] 1525#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/19 17:39:44 [emerg] 4211#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/24 07:27:11 [emerg] 1499#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/24 18:13:19 [emerg] 1537#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/24 18:52:03 [emerg] 1542#0: BIO_new_file("/etc/letsencrypt/live/specknz$
2016/07/24 22:57:59 [emerg] 1540#0: BIO_new_file("/etc/letsencrypt/live/specknz$

  GNU nano 2.2.6 File: error.log.4.gz

^_�^H^@JsoW^@^C��Mo�@^P�{��X�^G�R^Uf?
skչK��=�^XE�^C�^F^U���V��/·Y�*^PB/e�oև̇>�+f<� ��^@L �^AGmP�� n��~Ÿ^@^]�^Cd7i�̸^W�$
�}H^Rg˒�2gWɞ�9ەv�V�,�%�Օ?JM�^D�^?��U�e,.vY^Õ��zXʏ^U^R9�ҏǏ؏ȏ,ŏX�{$^_(�� {rؽ�Y^@
ӹt^B��jDɝهk&p^B�(x�^Ç^V(e^S�"^U�)�+�+D^S8�O^S�_a+�^�VrL͇^]ɇ_!�� {Rؽ�YE��ތ�Q4掣+$
,�oWi~����ŹQ�ŹŹ^Wdֹ¹!^H^@^N �ܗ�ݰ,�q+�ǰu��9~-X��oٰa=V8��ΰưU���|�2�ٰ���-^^V�^W6� ^D�$
1��?5HC�x� [2�`�`^@^H��^N�
�!�N^]R�ӹ'^A^Q9Թr����5g^E^@J�C-�Ĺ^Ry��^RRޟ��C�CB{^N)�ɡơ!α�*�SkImȱ3�������αQ�6�
]Ϲ_�^]ı�C�^RSԃڃ^Fу8��A^B�i��ʐ^Lz4H^^6d Qq�^W��A��a?�R{^[2C��ѐ Ðj^~�Ɓ^R�7�^OG�p�$

```

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 26, 2016, 2:52am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/8 "2016-07-26T02:52:47Z")

</div>

What does

```plaintext
./launcher logs app

```

give you?

Our nginx logs are actually in `/shared/log/var-log/nginx`

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 26, 2016, 11:49am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/9 "2016-07-26T11:49:58Z")

</div>

Those emerg entries on the nginx log mean he’s not gonna run. This is a problem with your ssl setup, it is missing deparams.

I recommend setting up ssl again.

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 26, 2016, 12:30pm UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/10 "2016-07-26T12:30:17Z")

</div>

> [@tgxworld](#):
>
> /shared/log/var-log/nginx

Unfortunately, it gives nothing.

```
root@discourse:~# ./launcher logs app
-su: ./launcher: No such file or directory

root@discourse:/# cd /shared/log/var-log/nginx
-su: cd: /shared/log/var-log/nginx: No such file or directory

```

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [July 26, 2016, 4:17pm UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/11 "2016-07-26T16:17:06Z")

</div>

Yeah, this is the problem. (“Emerg” = Emergency)

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 27, 2016, 4:44am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/12 "2016-07-27T04:44:26Z")

</div>

> [@](#):
>
> Those emerg entries on the nginx log mean he’s not gonna run. This is a problem with your ssl setup, it is missing deparams.
> 
> I recommend setting up ssl again.

I went through this tutorial [https://www.digitalocean.com/community/tutorials/how-to-install-discourse-behind-nginx-on-ubuntu-14-04#prerequisites](https://www.digitalocean.com/community/tutorials/how-to-install-discourse-behind-nginx-on-ubuntu-14-04#prerequisites) to recreate SSL Certificate on Nginx for Ubuntu 14.04 and got a message.

`root@discourse:/opt/letsencrypt# ./letsencrypt-auto certonly --standalone --email tamerlanium@gmail.com --agree-tos -d specknz.me`

```
The program exe (process ID 1304) is already listening on TCP port │
   │ 443. This will prevent us from binding to that port. Please stop the │
   │ exe program temporarily and then try again.

```

`At least one of the (possibly) required ports is already taken.`

```
root@discourse:/opt/letsencrypt# cd /etc/letsencrypt/live
-su: cd: /etc/letsencrypt/live: No such file or directory

root@discourse:/opt/letsencrypt# ls
acme letsencrypt-nginx
certbot letshelp-certbot
certbot-apache letshelp-letsencrypt
certbot-auto LICENSE.txt
certbot-compatibility-test linter_plugin.py
certbot-nginx MANIFEST.in
CHANGES.rst pep8.travis.sh
CONTRIBUTING.md README.rst
docker-compose.yml readthedocs.org.requirements.txt
Dockerfile setup.cfg
Dockerfile-dev setup.py
docs tests
examples tools
letsencrypt tox.cover.sh
letsencrypt-apache tox.ini
letsencrypt-auto Vagrantfile
letsencrypt-auto-source

```

And didn’t get a response similar to this:

Let’s Encrypt Output  
IMPORTANT NOTES:

- If you lose your account credentials, you can recover through  
e-mails sent to [sammy@example.com](mailto:sammy@example.com).
- Congratulations! Your certificate and chain have been saved at  
/etc/letsencrypt/live/discourse.example.com/fullchain.pem. Your  
cert will expire on 2016-04-26. To obtain a new version of the  
certificate in the future, simply run Let’s Encrypt again.
- Your account credentials have been saved in your Let’s Encrypt  
configuration directory at /etc/letsencrypt. You should make a  
secure backup of this folder now. This configuration directory will  
also contain certificates and private keys obtained by Let’s  
Encrypt so making regular backups of this folder is ideal.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 27, 2016, 4:49am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/13 "2016-07-27T04:49:53Z")

</div>

Hmm how was your Discourse instance setup? Are you on the docker based install?

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 27, 2016, 5:00am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/14 "2016-07-27T05:00:32Z")

</div>

Yeah, it have been installed through the Docker instance.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 27, 2016, 5:01am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/15 "2016-07-27T05:01:54Z")

</div>

Try following

> [@Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/setting-up-lets-encrypt/40709):
>
> bookmark This is a guide for enabling HTTPS on an existing Discourse installation using Let’s Encrypt. It assumes prior installation without HTTPS enabled. person_raising_hand Required user level: System Administrator exclamation This guide is only for existing installs where HTTPS is not enabled. Following the [official setup guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md) automatically enables HTTPS by default. So you’d like to add https to your Discourse absolutely free, courtesy of our friends at [Let’s Encrypt?](https://letsencrypt.org/)bell I…

to install a Let’s Encrypt cert instead

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 27, 2016, 5:26am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/16 "2016-07-27T05:26:20Z")

</div>

Sorry Guo, should I rebuild the Discourse container?

**4. Rebuild your container**

`./launcher rebuild <container name>`

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 27, 2016, 5:57am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/17 "2016-07-27T05:57:57Z")

</div>

> [@itamerlanium](#):
>
> Sorry Guo, should I rebuild the Discourse container?

Yes

Can you please try rebuilding?

Please SSH into your server and run:

```plaintext
cd /var/discourse
git pull
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 27, 2016, 6:12am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/21 "2016-07-27T06:12:26Z")

</div>

See:

> [@Discourse has stopped opening](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/17):
>
> Yes Can you please try rebuilding? Please SSH into your server and run: cd /var/discourse git pull ./launcher rebuild app

run `./launcher rebuild app`

---

<div class="post-metadata">

### Author: ![itamerlanium](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itamerlanium/32/56833_2.png) [@itamerlanium](https://meta.discourse.org/u/itamerlanium)
#### Post date: [July 27, 2016, 6:48am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/22 "2016-07-27T06:48:42Z")

</div>

Ups I missed it 🙂  
I’ve resized the Droplet to 1Gb by the using SWAP and tried to rebuild it, but it didn’t help me. However, yesterday I rebuild it successfully.

```
if ($http_host != $$ENV_DISCOURSE_HOSTNAME) {
   rewrite (.*) https://$$ENV_DISCOURSE_HOSTNAME$1 permanent;
} in /etc/nginx/conf.d/discourse.conf
I, [2016-07-27T06:45:30.779342 #13] INFO -- : > if [-z "$LETSENCRYPT_ACCOUNT_EMAIL"]; then echo "LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set."; exit 1; fi
I, [2016-07-27T06:45:30.782199 #13] INFO -- : LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set.

I, [2016-07-27T06:45:30.789702 #13] INFO -- : Terminating async processes
I, [2016-07-27T06:45:30.790433 #13] 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: 42
2016-07-27 06:45:30 UTC [42-2] LOG: received fast shutdown request
2016-07-27 06:45:30 UTC [42-3] LOG: aborting any active transactions
2016-07-27 06:45:30 UTC [49-2] LOG: autovacuum launcher shutting down
I, [2016-07-27T06:45:30.801912 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 155
155:signal-handler (1469601930) Received SIGTERM scheduling shutdown...
2016-07-27 06:45:30 UTC [46-1] LOG: shutting down
2016-07-27 06:45:30 UTC [46-2] LOG: database system is shut down
155:M 27 Jul 06:45:30.851 # User requested shutdown...
155:M 27 Jul 06:45:30.852 * Saving the final RDB snapshot before exiting.
155:M 27 Jul 06:45:30.990 * DB saved on disk
155:M 27 Jul 06:45:30.990 # Redis is now ready to exit, bye bye...

FAILED
--------------------
Pups::ExecError: if [-z "$LETSENCRYPT_ACCOUNT_EMAIL"]; then echo "LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set."; exit 1; fi failed with return #<Process::Status: pid 3087 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cmd"=>["if [-z \"$LETSENCRYPT_ACCOUNT_EMAIL\"]; then echo \"LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set.\"; exit 1; fi", "/bin/bash -c \"if [[! \\\"$LETSENCRYPT_ACCOUNT_EMAIL\\\" =~ ([^@]+)@([^\\.]+) ]]; then echo \\\"LETSENCRYPT_ACCOUNT_EMAIL is not a valid email address\\\"; exit 1; fi\""]}
b723307a27a32d6c808e520b0cc3000fa2cbfe732291dd1bb312e7c9b8bfb375
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one
root@discourse:/var/discourse#

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 27, 2016, 6:57am UTC](https://meta.discourse.org/t/discourse-has-stopped-opening/47710/23 "2016-07-27T06:57:35Z")

</div>

`LETSENCRYPT_ACCOUNT_EMAIL ENV variable is required and has not been set.`

hmmm… is that set?

[Next page](https://meta.discourse.org/t/discourse-has-stopped-opening/47710.md?page=2)
