# 새 호스트에서 빌드 실패

**URL:** https://meta.discourse.org/t/build-fails-on-new-host/220755
**Category:** Self-hosting
**Created:** [3월 11, 2022, 5:01오후 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755 "2022-03-11T17:01:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Samir\_Faci](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_faci/32/119582_2.png) [@Samir\_Faci](https://meta.discourse.org/u/Samir_Faci)
#### Post date: [3월 11, 2022, 5:01오후 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755/1 "2022-03-11T17:01:25Z")

</div>

전체 /var/discourse를 새 호스트로 복사했습니다. CNAME과 SSL도 업데이트했고 모두 정상적으로 작동합니다. 재빌드(rebuild)를 시도하면 해결할 수 없는 문제가 발생합니다.

```sh
 sudo ./launcher rebuild app
I, [2022-03-11T16:50:42.832830 #1] INFO -- :
I, [2022-03-11T16:50:42.833980 #1] INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2022-03-11T16:50:42.834524 #1] INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2022-03-11T16:50:42.834854 #1] INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2022-03-11T16:50:42.835184 #1] INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2022-03-11T16:50:42.835501 #1] INFO -- : Replacing (?-mix:worker_connections.+$) with worker_connections $nginx_worker_connections ; in /etc/nginx/nginx.conf
I, [2022-03-11T16:50:42.835804 #1] INFO -- : > echo "done configuring web"
I, [2022-03-11T16:50:42.839749 #1] INFO -- : done configuring web

I, [2022-03-11T16:50:42.840160 #1] INFO -- : > cd /var/www/discourse && gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
ERROR: Could not find a valid gem 'bundler' (= 2.3.4), here is why:
          Unable to download data from https://rubygems.org/ - Net::OpenTimeout: execution expired (https://rubygems.org/specs.4.8.gz)
I, [2022-03-11T16:55:43.338723 #1] INFO -- :
I, [2022-03-11T16:55:43.339140 #1] INFO -- : Terminating async processes
I, [2022-03-11T16:55:43.339338 #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/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
I, [2022-03-11T16:55:43.339402 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2022-03-11 16:55:43.339 UTC [42] LOG: received fast shutdown request
103:signal-handler (1647017743) Received SIGTERM scheduling shutdown...
2022-03-11 16:55:43.340 UTC [42] LOG: aborting any active transactions
2022-03-11 16:55:43.342 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2022-03-11 16:55:43.346 UTC [46] LOG: shutting down
2022-03-11 16:55:43.361 UTC [42] LOG: database system is shut down
103:M 11 Mar 2022 16:55:43.363 # User requested shutdown...
103:M 11 Mar 2022 16:55:43.363 * Saving the final RDB snapshot before exiting.
103:M 11 Mar 2022 16:55:43.433 * DB saved on disk
103:M 11 Mar 2022 16:55:43.434 # Redis is now ready to exit, bye bye...

```

wget로 rubygems를 가져오는 것은 정상 작동하며 인터넷 연결에도 문제가 없습니다. 어떤 조언을 주실 수 있을까요?

---

<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: [3월 11, 2022, 5:13오후 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755/2 "2022-03-11T17:13:20Z")

</div>

> [@Samir\_Faci](#):
>
> `https://rubygems.org/에서 데이터를 다운로드할 수 없습니다 - Net::OpenTimeout: 실행 시간 초과`

> [@Samir\_Faci](#):
>
> wget로 rubygems에 접근하면 정상적으로 작동하며, 인터넷 연결도 문제없습니다.

호스트에서 인터넷 연결이 정상적으로 작동한다면, 해당 호스트의 Docker 컨테이너 내부의 인터넷 연결을 디버깅해야 합니다.

> [@컨테이너 빌드 불가, 명확한 오류 없음](https://meta.discourse.org/t/cant-build-container-no-clear-errors/219495/2?u=falco):
>
> The real problem is this one: If the server/container can’t access the Discourse source code in GitHub it won’t be able to build/update. Since you said it works on the host, you need to debug the container networking. Drop to a similar container shell with docker run --it debian:buster-slim bash and debug from there.

---

<div class="post-metadata">

### Author: ![Samir\_Faci](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_faci/32/119582_2.png) [@Samir\_Faci](https://meta.discourse.org/u/Samir_Faci)
#### Post date: [3월 12, 2022, 2:21오전 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755/3 "2022-03-12T02:21:07Z")

</div>

문제를 찾았습니다. Docker에서 IPv6를 활성화해 두었는데, 이게 문제를 일으키는 것 같았습니다.

IPv6를 비활성화한 후 Docker를 다시 로드해야 했습니다.

```json
{
  "ipv6": false,
  "fixed-cidr-v6": "2001:db8:1::/64"
}

```

도와주셔서 감사합니다!

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [3월 12, 2022, 3:09오전 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755/4 "2022-03-12T03:09:18Z")

</div>

> [@Samir\_Faci](#):
>
> `"fixed-cidr-v6": "2001:db8:1::/64"`

구체적으로 말씀드리면, IPv6가 활성화되어 있었고 컨테이너로 다시 돌아오지 않는 주소들을 할당하도록 설정되어 있었습니다.

모든 애플리케이션이 v6 연결이 끊어졌을 때 v4로 폴백되도록 작성되어 있지는 않습니다.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [4월 11, 2022, 3:09오전 UTC](https://meta.discourse.org/t/build-fails-on-new-host/220755/5 "2022-04-11T03:09:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
