# 2.5.0.beta4로 업그레이드 문제

**URL:** https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364
**Category:** Self-hosting
**Created:** [5월 4, 2020, 8:08오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364 "2020-05-04T20:08:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sturdy2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sturdy2/32/138218_2.png) [@sturdy2](https://meta.discourse.org/u/sturdy2)
#### Post date: [5월 4, 2020, 8:08오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/1 "2020-05-04T20:08:02Z")

</div>

Docker를 업그레이드하기 위해 업그레이드 버튼을 클릭했습니다. 완료 후 모든 것이 정상적으로 진행되는 것처럼 보였습니다. 돌아가기를 클릭한 후 다음과 같은 메시지를 받았습니다:

> ```
> 현재 사용 중인 Discourse 이미지가 오래된 버전입니다.
> 최신 이미지를 실행할 때까지 웹 UI를 통한 업그레이드는 비활성화됩니다.
> 이를 수행하려면 SSH를 통해 서버에 로그인하고 다음을 실행하세요:
> 
> cd /var/discourse
> git pull
> ./launcher rebuild app
> 
> ```

위 단계를 수행했지만 다음과 같은 오류가 발생했습니다:

```
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# cd /var/discourse
root@ubuntu-s-1vcpu-1gb-nyc1-01:/var/discourse# git pull
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 22 (delta 11), reused 12 (delta 6), pack-reused 0
Unpacking objects: 100% (22/22), done.
From https://github.com/discourse/discourse_docker
   70a3323..8c8dbd0 master -> origin/master
 * [new branch] pg12 -> origin/pg12
Updating 70a3323..8c8dbd0
Fast-forward
 launcher | 2 +-
 templates/sshd.template.yml | 49 ---------------------------------------------
 templates/web.template.yml | 2 ++
 3 files changed, 3 insertions(+), 50 deletions(-)
 delete mode 100644 templates/sshd.template.yml
root@ubuntu-s-1vcpu-1gb-nyc1-01:/var/discourse# ./launcher rebuild app

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/base:2.0.20200429-2110' locally
2.0.20200429-2110: Pulling from discourse/base
54fec2fa59d0: Pulling fs layer
19bc9811812d: Pulling fs layer
54fec2fa59d0: Verifying Checksum
54fec2fa59d0: Download complete
54fec2fa59d0: Pull complete
19bc9811812d: Verifying Checksum
19bc9811812d: Download complete
19bc9811812d: Pull complete
Digest: sha256:3400307b0464d1fc70f554f990e22842f0abe82e3ed42fbee1eb5bad464ce008
Status: Downloaded newer image for discourse/base:2.0.20200429-2110
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
Already up to date.
I, [2020-05-04T19:34:20.671303 #1] INFO -- : Loading --stdin
I, [2020-05-04T19:34:20.680407 #1] INFO -- : > locale-gen $LANG && update-locale
I, [2020-05-04T19:34:20.754357 #1] INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2020-05-04T19:34:20.755052 #1] INFO -- : > mkdir -p /shared/postgres_run
I, [2020-05-04T19:34:20.763216 #1] INFO -- : 
I, [2020-05-04T19:34:20.765101 #1] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2020-05-04T19:34:20.769530 #1] INFO -- : 
I, [2020-05-04T19:34:20.770264 #1] INFO -- : > chmod 775 /shared/postgres_run
I, [2020-05-04T19:34:20.774593 #1] INFO -- : 
I, [2020-05-04T19:34:20.775571 #1] INFO -- : > rm -fr /var/run/postgresql
I, [2020-05-04T19:34:20.780287 #1] INFO -- : 
I, [2020-05-04T19:34:20.781259 #1] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2020-05-04T19:34:20.785953 #1] INFO -- : 
I, [2020-05-04T19:34:20.786915 #1] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2020-05-04T19:34:20.884925 #1] INFO -- : postgres already running stop container

FAILED
--------------------
Pups::ExecError: socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1 failed with return #<Process::Status: pid 25 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1"
28acae3e3ece0cb518bcdb99f94ff1f21dc7b8663ab30720b7d7dad43dcc6d52
**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.

```

Discourse-doctor 실행 결과도 비슷합니다. 이 문제를 식별해 주시고 올바른 방향으로 안내해 주실 수 있는 분이 있을까요? 감사합니다.

**수정: OS를 재부팅하고 앱을 재구축한 후 모든 것이 정상적으로 작동합니다. 문제가 무엇이었는지 모르겠습니다.**

---

<div class="post-metadata">

### Author: ![yoursql719](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yoursql719/32/120350_2.png) [@yoursql719](https://meta.discourse.org/u/yoursql719)
#### Post date: [5월 4, 2020, 8:29오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/2 "2020-05-04T20:29:00Z")

</div>

나도 문제가 있어요. 제 에러는 다음과 같습니다:

> ```
> Ensuring launcher is up to date
> Fetching origin
> Launcher is up-to-date
> Stopping old container
> + /usr/bin/docker stop -t 10 app
> app
> cat: templates/sshd.template.yml: No such file or directory
> cd /pups && git pull && /pups/bin/pups --stdin
> /usr/bin/docker: invalid reference format: repository name must be lowercase.
> See '/usr/bin/docker run --help'.
> cat: cids/app_bootstrap.cid: No such file or directory
> "docker rm" requires at least 1 argument.
> See 'docker rm --help'.
> Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
> Remove one or more containers
> rm: cannot remove 'cids/app_bootstrap.cid': No such file or directory
> **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.
> 
> ```

지금까지 Discourse는 잘 작동하고 있었는데…

---

<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: [5월 4, 2020, 8:48오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/3 "2020-05-04T20:48:51Z")

</div>

> [@yoursql719](#):
>
> cat: templates/sshd.template.yml: No such file or directory

app.yml 상단 근처에 포함된 ssh 템플릿을 제거해야 합니다. [ssh 템플릿이 제거되었기 때문에 다시 빌드할 수 없음](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285)

OP의 문제가 무엇인지 모르겠습니다.

---

<div class="post-metadata">

### Author: ![samyrabih](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samyrabih/32/121356_2.png) [@samyrabih](https://meta.discourse.org/u/samyrabih)
#### Post date: [5월 7, 2020, 10:15오전 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/5 "2020-05-07T10:15:55Z")

</div>

여기서도 같은 문제가 발생합니다. Docker는 최신 상태(19.03)이며, 수동 업그레이드를 하기 직전에 git pull을 실행했습니다.

(웹 UI를 통한 업데이트가 불가능하며, “업그레이드 중” 화면에서 멈춰 있습니다)

---

<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: [5월 8, 2020, 7:25오전 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/6 "2020-05-08T07:25:22Z")

</div>

> [@yoursql719](#):
>
> cat: templates/sshd.template.yml: No such file or directory

`app.yml`에서 해당 행을 삭제했는지 확인하세요. 그 행은 필요하지 않습니다.

---

<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: [5월 8, 2020, 7:27오전 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/7 "2020-05-08T07:27:41Z")

</div>

> [@sturdy2](#):
>
> 파라미터 "socat /dev/null UNIX-CONNECT:/shared/postgres\_run/.s.PGSQL.5432"로 exec 실행이 실패했습니다.

`docker ps`의 출력 결과는 무엇인가요? 단일 컨테이너를 실행 중인가요?

실행 중인 컨테이너가 없다면 해당 소켓 파일을 삭제하세요. 호스트에 `socat`이 설치되어 있는지 확인하세요.

---

<div class="post-metadata">

### Author: ![sturdy2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sturdy2/32/138218_2.png) [@sturdy2](https://meta.discourse.org/u/sturdy2)
#### Post date: [5월 8, 2020, 4:33오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/8 "2020-05-08T16:33:51Z")

</div>

sam님 감사합니다. 제 수정, 재부팅, 그리고 앱 재빌드가 문제를 해결했습니다. 방금 import 컨테이너가 계속 실행 중이었음을 발견했고, 이제 이를 제거했습니다. Socat은 설치되어 있습니다. docker ps 출력 결과는 다음과 같습니다.

```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e3c0fe465fb3 local_discourse/app "/sbin/boot" 2 days ago Up 11 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app

```

현재 beta4를 3일째 실행 중이며 모든 것이 정상으로 보입니다. 정말 감사합니다.

---

<div class="post-metadata">

### Author: ![Uninen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/uninen/32/66432_2.png) [@Uninen](https://meta.discourse.org/u/Uninen)
#### Post date: [5월 11, 2020, 1:33오후 UTC](https://meta.discourse.org/t/problem-upgrade-to-2-5-0-beta4/150364/9 "2020-05-11T13:33:05Z")

</div>

수동 업그레이드에서 비슷한 문제를 겪었는데, sshd 템플릿에 대한 힌트는 전혀 없고 단순히 `cat: cids/app_bootstrap.cid: No such file or directory` 오류만 발생했습니다. 하지만 app.yml에서 sshd 템플릿 주석 처리 후 재빌드하니 정상적으로 작동했습니다.
