런처 재빌드 시 아무것도 표시되지 않음

MySQL gem을 앱 컨테이너에 추가하는 방법에 대한 가이드를 따르고 있습니다. 튜토리얼 링크: Use an import script that requires MySQL - #4 by pfaffman

하지만 다음 명령을 실행하면 프로세스가 멈춰버립니다.

> ./launcher stop app
> ./launcher rebuild import

image
CTRL+C로 프로세스를 종료하기 전까지는 아무 반응이 없습니다.

참고: 몇 시간 이상 응답을 기다렸지만 아무런 변화가 없었습니다.

도커 컨테이너를 확인해 보니 새로 생성된 (손상된) 정지 상태의 컨테이너가 보입니다.

image

이러한 현상이 발생하는 원인이 무엇인지 정확히 알 수 없습니다.

제 containers/import.yml 파일 내용입니다. (변경하지 않은 부분은 생략했습니다)

서버는 DO(DigitalOcean)에 호스팅되어 있으며, 도커 서비스를 재시작하면 원래 실행 중이던 앱 컨테이너로 돌아옵니다.

image

P.S: ./launcher rebuild app은 정상적으로 작동합니다.

빌드 전에 ./launcher stop app;을 실행해 보는 건 어떨까요?

수정:

아, 진짜.

네, 당연히 stop 하위 명령어 실행 후 rebuild를 실행하고 있습니다. 질문을 수정하겠습니다.

OK, 이해했습니다. 컨테이너를 중지한 후

> ./launcher stop app

또한 컨테이너를 제거(docker rm app)하고 다시 빌드해 보았는데, 그때는 더 멀리까지 진행되었습니다.

현재 mysql-dep 템플릿을 사용하는 단계에서 다음과 같은 오류가 발생합니다.

...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-4) ...
Setting up nettle-dev:amd64 (3.4.1-1) ...
Setting up libgnutls28-dev:amd64 (3.6.7-4+deb10u2) ...
Setting up libmariadb-dev (1:10.3.22-0+deb10u1) ...
Processing triggers for libc-bin (2.28-10) ...

I, [2020-02-27T16:51:33.937186 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'test development'`, and stop using this flag
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /var/www/discourse/Gemfile freeze 
by running `bundle config unset deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* mysql2
I, [2020-02-27T16:51:34.670930 #1]  INFO -- : 
I, [2020-02-27T16:51:34.672542 #1]  INFO -- : Terminating async processes
I, [2020-02-27T16:51:34.673101 #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/10/bin/postmaster -D /etc/postgresql/10/main pid: 49
I, [2020-02-27T16:51:34.673593 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
2020-02-27 16:51:34.674 UTC [49] LOG:  received fast shutdown request
166:signal-handler (1582822294) Received SIGTERM scheduling shutdown...
2020-02-27 16:51:34.682 UTC [49] LOG:  aborting any active transactions
166:M 27 Feb 2020 16:51:34.693 # User requested shutdown...
166:M 27 Feb 2020 16:51:34.695 * Saving the final RDB snapshot before exiting.
2020-02-27 16:51:34.698 UTC [49] LOG:  worker process: logical replication launcher (PID 58) exited with exit code 1
2020-02-27 16:51:34.701 UTC [53] LOG:  shutting down
166:M 27 Feb 2020 16:51:34.741 * DB saved on disk
166:M 27 Feb 2020 16:51:34.742 # Redis is now ready to exit, bye bye...
2020-02-27 16:51:34.786 UTC [49] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development' failed with return #<Process::Status: pid 970 exit 16>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["echo \"gem 'mysql2'\" >> Gemfile", "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmariadb-dev", "su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development'"]}
75b27d60e1dc3a4b5d76bc75f2874ebf405fe29edfebec3cb809233f7b01ec48
** 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.

이 오류에 대해 아시는 분이 계신가요?

저도 비슷한 문제를 겪고 있습니다. 이는 Failed to bootstrap using import template 와 같은 문제인 것 같습니다.

이 문제를 이미 확인했기 때문에 해당 컨테이너를 업그레이드하려는 시도를 하지 말아야 했는데, 다른 이상한 에러 때문에 결국 시도해 보았습니다. . .

수정: 템플릿에 다음을 추가했습니다.

su discourse -c 'bundle config unset deployment'

이것은 다음 줄 앞에 위치합니다.

 su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'

이렇게 하니 작동합니다. (하지만 아쉽게도 제 무관한 문제는 해결되지 않았습니다).

지난주에 이 템플릿을 실제로 사용했는데 아무 문제가 없었어요. 좀 의아하긴 하지만, 다음 주에 한번 살펴볼 가치가 있을 것 같아요. 제 목록에 추가해 둘게요.

저도 마찬가지예요! 그런데 업그레이드된 버전에서는 문제가 있는 걸까요?

코멘트 외에도, 런처의 선행 조건을 건너뛰어야 했습니다.

> ./launcher rebuild import --skip-prereqs

그리고 @pfaffman 님의 제안에 따라

이미지가 성공적으로 빌드되었습니다. :white_check_mark:

여기서는 해결된 것 같습니다 – @pfaffman @rahilqf 확인해 주시겠어요?

그렇게 보입니다. 정말 감사합니다!

php-serialize를 추가하는 템플릿만 있으면 좋겠는데…