# Discourse Docker 설정 마지막 단계에서 발생하는 데이터베이스 종료 오류

**URL:** https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383
**Category:** Self-hosting
**Created:** [9월 17, 2020, 8:04오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383 "2020-09-17T20:04:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shoaib\_mohammed](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shoaib\_mohammed](https://meta.discourse.org/u/shoaib_mohammed)
#### Post date: [9월 17, 2020, 8:04오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/1 "2020-09-17T20:04:04Z")

</div>

팀 여러분, 안녕하세요. 다음 링크의 가이드를 따라 AWS EC2에서 Docker 기반 Discourse를 설정하려고 시도하고 있습니다: [https://www.axelfernandes.com/how-to-configure-discourse-on-amazon-web-services-aws](https://www.axelfernandes.com/how-to-configure-discourse-on-amazon-web-services-aws)

마지막 단계를 제외한 모든 과정은 문제없이 진행되었습니다. 어떤 오류인지 조언해 주실 수 있을까요?

```
I, [2020-09-17T19:56:38.330642 #1] INFO -- : File > /etc/nginx/letsencrypt.conf chmod: chown: 
I, [2020-09-17T19:56:38.334734 #1] INFO -- : File > /etc/runit/1.d/letsencrypt chmod: +x chown: 
I, [2020-09-17T19:56:38.334916 #1] INFO -- : Replacing (?-mix:ssl_certificate.+) with ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.cer;
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.cer;
 in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.335173 #1] INFO -- : Replacing (?-mix:#?ACCOUNT_EMAIL=.+) with ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL
 in /shared/letsencrypt/account.conf
I, [2020-09-17T19:56:38.335395 #1] INFO -- : Replacing (?-mix:ssl_certificate_key.+) with ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.key;
ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.key;
 in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.335982 #1] INFO -- : Replacing (?-mix:add_header.+) with add_header Strict-Transport-Security 'max-age=63072000'; in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.336602 #1] INFO -- : Replacing location @discourse { with location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain in /etc/nginx/conf.d/discourse.conf
I, [2020-09-17T19:56:38.337288 #1] INFO -- : > echo "Beginning of custom commands"
I, [2020-09-17T19:56:38.339060 #1] INFO -- : Beginning of custom commands

I, [2020-09-17T19:56:38.339171 #1] INFO -- : > echo "End of custom commands"
I, [2020-09-17T19:56:38.340989 #1] INFO -- : End of custom commands

I, [2020-09-17T19:56:38.341091 #1] INFO -- : Terminating async processes
I, [2020-09-17T19:56:38.341176 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgre
sql/12/bin/postmaster -D /etc/postgresql/12/main pid: 49
2020-09-17 19:56:38.341 UTC [49] LOG: received fast shutdown request
I, [2020-09-17T19:56:38.341692 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
166:signal-handler (1600372598) Received SIGTERM scheduling shutdown...
2020-09-17 19:56:38.344 UTC [49] LOG: aborting any active transactions
2020-09-17 19:56:38.347 UTC [49] LOG: background worker "logical replication launcher" (PID 58) exited with exit code 1
2020-09-17 19:56:38.349 UTC [53] LOG: shutting down
2020-09-17 19:56:38.416 UTC [49] LOG: database system is shut down
166:M 17 Sep 2020 19:56:38.419 # User requested shutdown...
166:M 17 Sep 2020 19:56:38.419 * Saving the final RDB snapshot before exiting.
166:M 17 Sep 2020 19:56:38.423 * DB saved on disk
166:M 17 Sep 2020 19:56:38.424 # Redis is now ready to exit, bye bye...
sha256:80ffaa9115dbe8b1cfdc8d77dd25054e4fbd6be896fa19f6330448110e2e7251
68b73bf7854c91ff7e9cc5c7748e2826a85e6a6cdb62508d4b26cc9fc4cfd12d
Removing old container
+ /usr/bin/docker rm app
app

+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e
 RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCO
URSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=testdiscourse.com -e DISCOURSE_DEVELOPER_EMAILS=sho_xxxxxx_92@gmail.com -e DISCOURSE_SMTP_ADDRESS=smtp.sendgr
id.net -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=SG.xxxxxx -e DISCOURSE_SMTP_PASSWORD=SG.xxxxxx -e LETSENCRYPT_ACCOUNT_EMAIL=me@example.com -h ip-172-31-4-9-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse
/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:3a:b7:1a:8e:ae local_discourse/app /sbin/boot

```

---

<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: [9월 17, 2020, 8:29오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/2 "2020-09-17T20:29:17Z")

</div>

로그에서 실제 오류를 찾지 못했습니다. 더 위쪽이나 아래쪽에 있을 수 있습니다.

> [@shoaib\_mohammed](#):
>
> `DISCOURSE_SMTP_PASSWORD=`

게시글에서 비밀번호를 제거했지만, SendGrid에 가서 애플리케이션 시크릿을 재발급해야 합니다.

> [@shoaib\_mohammed](#):
>
> `DISCOURSE_HOSTNAME=testdiscourse.com`

직접 관리하는 도메인 이름을 사용해야 합니다.

---

<div class="post-metadata">

### Author: ![shoaib\_mohammed](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shoaib\_mohammed](https://meta.discourse.org/u/shoaib_mohammed)
#### Post date: [9월 17, 2020, 8:33오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/3 "2020-09-17T20:33:22Z")

</div>

@riking 말씀이 맞습니다. 엄밀히 말해 실제 오류는 없습니다. 다만 SendGrid에 문제가 있습니다. 아래는 설정 내용입니다. 문제의 원인이 무엇일까요? 'application secret을 cycle한다’고 말씀하신 것이 무슨 의미인지 설명해 주실 수 있을까요? 다시 생성(recreate)하라는 뜻인가요?

DISCOURSE\_SMTP\_ADDRESS: [smtp.sendgrid.net](http://smtp.sendgrid.net)  
DISCOURSE\_SMTP\_PORT: 2525  
DISCOURSE\_SMTP\_USER\_NAME: apiKey  
DISCOURSE\_SMTP\_PASSWORD: “SG.N6X4OZGjS\_xxxxxx”

---

<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: [9월 17, 2020, 8:40오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/4 "2020-09-17T20:40:01Z")

</div>

잠깐, 그래서 이메일 전송이 원래 문제였나요?

네, SendGrid 콘솔에 들어가서 이전에 사용하던 비밀번호를 "해지"하고 새로운 비밀번호를 생성해야 합니다.

---

<div class="post-metadata">

### Author: ![shoaib\_mohammed](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shoaib\_mohammed](https://meta.discourse.org/u/shoaib_mohammed)
#### Post date: [9월 17, 2020, 8:42오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/5 "2020-09-17T20:42:03Z")

</div>

@riking 실제로 처음에는 그런 문제가 없었습니다. 로그 때문에 걱정되었는데, 나중에 이메일이 전달되지 않는다는 걸 알게 되었습니다.

---

<div class="post-metadata">

### Author: ![shoaib\_mohammed](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shoaib\_mohammed](https://meta.discourse.org/u/shoaib_mohammed)
#### Post date: [9월 17, 2020, 8:55오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/6 "2020-09-17T20:55:31Z")

</div>

@riking 새 키를 적용한 후에도 이메일이 여전히 깨져 있습니다. 다른 부분도 조치해야 하나요?

---

<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: [9월 17, 2020, 8:58오후 UTC](https://meta.discourse.org/t/database-shut-down-error-at-the-end-of-discourse-docker-setup/164383/7 "2020-09-17T20:58:27Z")

</div>

이 #howto 가이드를 확인해 보시고,那里的 단계가 문제를 해결하는지 살펴보세요.

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/):
>
> You just installed Discourse via [the install guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md), but email doesn’t seem to work. Unfortunately this means you can’t log in as an admin to finalize the install. cry Let’s troubleshootize! Try the doctor woman_health_workerIf you run ./discourse-doctor it will check several ways that your mail configuration might be broken, and offer advice. Try that first. Did you enter email settings correctly? The simplest way is to run ./discourse-setup again. Did you enter everything correctly? B…
