# 인트라넷에 Discourse 설치 - bootstrap 실패, 종료 코드 17

**URL:** https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [4월 2, 2024, 10:17오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014 "2024-04-02T10:17:36Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 2, 2024, 10:17오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/1 "2024-04-02T10:17:36Z")

</div>

안녕하세요,

저는 인트라넷 환경에 Discourse를 설치하고 있습니다. 재빌드(rebuild) 과정 중 가끔 다음과 같은 오류가 발생합니다:

> Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle install --retry 3 --jobs 4’ failed with return #\<Process::Status: pid 645 exit 17\>  
> Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec\_command.rb:132:in `spawn’  
> exec failed with the params {“cd”=\>“$home”, “hook”=\>“bundle\_exec”, “cmd”=\>[“su discourse -c ‘bundle config --local deployment true’”, “su discourse -c ‘bundle config --local without "development test"’”, “su discourse -c ‘bundle install --retry 3 --jobs 4’”]}  
> bootstrap failed with exit code 17  
> \*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one.  
> ./discourse-doctor may help diagnose the problem.  
> 6ef3d42536c82021bdb1f24980cbd860572869f207e4eb2001e59e8923b182cf  
> root@wpyb3816:/var/discourse# cat /etc/docker/daemon.json

이것이 무엇 때문일 수 있는지 아는 분이 계신가요?  
감사합니다.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [4월 2, 2024, 10:25오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/2 "2024-04-02T10:25:59Z")

</div>

빌드 로그의 앞부분에서 다른 오류 메시지가 표시됩니까?

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 2, 2024, 11:37오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/3 "2024-04-02T11:37:28Z")

</div>

> I, [2024-03-29T14:58:21.260866 #1] INFO – :  
> I, [2024-03-29T14:58:21.261079 #1] INFO – : \> su postgres -c ‘createdb discourse’ || true  
> 2024-03-29 14:58:21.298 UTC [55] postgres@postgres ERROR: database “discourse” already exists  
> 2024-03-29 14:58:21.298 UTC [55] postgres@postgres STATEMENT: CREATE DATABASE discourse;  
> createdb: error: database creation failed: ERROR: database “discourse” already exists  
> I, [2024-03-29T14:58:21.299606 #1] INFO – :  
> I, [2024-03-29T14:58:21.299710 #1] INFO – : \> su postgres -c ‘psql discourse -c “create user discourse;”’ || true  
> 2024-03-29 14:58:21.334 UTC [59] postgres@discourse ERROR: role “discourse” already exists  
> 2024-03-29 14:58:21.334 UTC [59] postgres@discourse STATEMENT: create user discourse;  
> ERROR: role “discourse” already exists

그리고 크래시 전에 또 다른 오류가 발생했습니다 …

> [2024-03-29T14:59:48.410149 #1] INFO – : \> cd /var/www/discourse && su discourse -c ‘bundle install --retry 3 --jobs 4’  
> Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for [https://rubygems.org/](https://rubygems.org/).  
> There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see [OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps](https://railsapps.github.io/openssl-certificate-verify-failed.html).  
> Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for [https://rubygems.org/](https://rubygems.org/).  
> There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see [OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps](https://railsapps.github.io/openssl-certificate-verify-failed.html).  
> Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for [https://rubygems.org/](https://rubygems.org/).  
> There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see [OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps](https://railsapps.github.io/openssl-certificate-verify-failed.html).  
> Could not verify the SSL certificate for [https://rubygems.org/](https://rubygems.org/).  
> There is a chance you are experiencing a man-in-the-middle attack, but most  
> likely your system doesn’t have the CA certificates needed for verification. For  
> information about OpenSSL certificates, see  
> [OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps](https://railsapps.github.io/openssl-certificate-verify-failed.html).  
> I, [2024-03-29T14:59:49.328710 #1] INFO – : Fetching source index from [https://rubygems.org/](https://rubygems.org/)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 2, 2024, 12:33오후 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/4 "2024-04-02T12:33:10Z")

</div>

> [@peyrusse](#):
>
> bundle install --retry 3 --jobs 4’  
> Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate

이것이 문제입니다. 인터넷이 rubygems에 대한 접근을 차단하는 것으로 보입니다.

Discourse는 https를 필요로 하며, 표준 설치 환경은 인증서를 발급받기 위해 공개 IP를 통해 접근 가능해야 합니다. 이 문제로 인해 추가적인 어려움이 발생할 가능성이 높습니다.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 2, 2024, 12:39오후 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/5 "2024-04-02T12:39:18Z")

</div>

네, 해당 URL을 열기 위해 내부 요청을 접수했습니다. 인트라넷 환경에서는 기본적으로 모든 URL이 차단되어 있기 때문입니다.

완료되는 대로 결과를 알려드리겠습니다. 감사합니다.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 8, 2024, 12:21오후 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/6 "2024-04-08T12:21:13Z")

</div>

[https://rubygems.org/](https://rubygems.org/) URL에서도 동일한 오류가 발생합니다 …

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 8, 2024, 4:22오후 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/7 "2024-04-08T16:22:26Z")

</div>

서버를 모든 사이트로 열 수 없다면, 메시지를 직접 확인한 후 로드된 사이트를 하나씩 열어야 합니다. 6일 주기로 처리한다면, 1~2개월은 걸릴 것으로 예상됩니다.

인터넷에 접근할 수 있는 사설 인트라넷에서 Discourse를 사용하는 것은 공식적으로 지원되지 않습니다. 다른 곳에서 이미지를 빌드한 후 인트라넷에서 시작을 시도해 볼 수는 있습니다. 그러나 HTTPS 인증서를 얻는 방법은 직접 찾아야 합니다.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 10, 2024, 6:40오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/8 "2024-04-10T06:40:45Z")

</div>

안녕하세요,

제가 수행한 작업은 다음과 같습니다:

- PC에서 인트라넷 외부에서 이미지를 생성했습니다.
- 해당 이미지를 리포지토리에 업로드했습니다.
- 인트라넷의 VM에서 이미지를 가져온 후 컨테이너를 시작했습니다.  
**./launcher start app --run-image my image**

컨테이너는 정상적으로 작동하지만, 포트 80/443에 접근할 수 없는 것 같습니다(nmap으로 확인했을 때 포트는 열려 있습니다!). 브라우저에서 앱에 접근할 수 없습니다. `curl -v localhost:80`을 입력하면 다음과 같은 오류가 발생합니다.

```plaintext
* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,.laposte.fr'
* Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 10, 2024, 10:30오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/9 "2024-04-10T10:30:02Z")

</div>

내 추측은 인증서가 없고 nginx가 실패하고 있다는 것입니다. ssl과 let’s encrypt 템플릿을 제거하고 새로운 이미지를 빌드해야 합니다. 그런 다음 인증서가 있는 리버스 프록시가 필요합니다.

대신 직접 생성한 인증서를 사용할 수도 있습니다. let’s encrypt가 존재하기 전에 어떻게 하는지에 대한 주제(토론)가 여전히 남아 있을 것 같습니다.

nginx 로그를 확인하여 오류를 살펴볼 수 있습니다.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [4월 10, 2024, 11:19오전 UTC](https://meta.discourse.org/t/discourse-installation-on-intranet-bootstrap-failed-with-exit-code-17/302014/10 "2024-04-10T11:19:55Z")

</div>

app.yml 파일에서 letsencrypt 템플릿을 활성화하지 않았으므로, 이 제거 요청에 대해 걱정할 필요가 없는 것이 맞나요? 저는 자체 인증서를 가진 프론트 엔드 VIP를 사용하고 있습니다.
