Yarn 오류

리빌딩하는 중에 6분 정도 이 부분에 막혀있어요

그냥 빠르게 리빌드하고 싶었는데 :frowning: 근데 20분 가까이 걸렸네. 알았으면 새벽 3시쯤까지 기다렸다가 했을 텐데, ssh 세션을 종료하고 다시 리빌드해봤어. 어떻게 될지 지켜보자

수정: ./discourse-docter 같은 걸 실행하니까 다시 온라인이 됐어. app.yml이 업데이트되길 바랐는데, 실제로 업데이트가 됐는지도 모르겠고

Error during the update ESOCKETTIMEDOUT registry.yarnpkg.com 를 참조하세요.

고마워요, 새벽 3시쯤이나 그 이후에 한번 시도해볼게요.

정말 혼란스럽네요. 게시하신 토픽에서 말씀하신 159번째 줄이 제 것과 다르거든요..

하지만 "yarn"을 검색해 보니 이런 걸 찾았어요

런처가 최신 상태인지 확인하는 중
원본 가져오기(Fetching origin)
런처가 최신 상태입니다
기존 컨테이너 중지
+ /usr/bin/docker stop -t 600 app
app
2.0.20240502-0021: discourse/base에서 가져오는 중
Digest: sha256:ca10543693caa0b52f7318105dea1d47a84991e7927330db1010e13e39777ba7
Status: discourse/base:2.0.20240502-0021 이미지가 최신 상태입니다
docker.io/discourse/base:2.0.20240502-0021
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2024-05-09T03:58:42.050521 #1]  INFO -- : stdin에서 읽는 중
I, [2024-05-09T03:58:42.077104 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown: 
I, [2024-05-09T03:58:42.095108 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2024-05-09T03:58:42.108229 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2024-05-09T03:58:42.126445 #1]  INFO -- : File > /root/install_postgres  chmod: +x  chown: 
I, [2024-05-09T03:58:42.145105 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown: 
I, [2024-05-09T03:58:42.145716 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 data_directory = '/var/lib/postgresql/13/main'를 data_directory = '/shared/postgres_data'로 대체
I, [2024-05-09T03:58:42.147110 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?listen_addresses *=.*)를 listen_addresses = '*'로 대체
I, [2024-05-09T03:58:42.150337 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?synchronous_commit *=.*)를 synchronous_commit = $db_synchronous_commit로 대체
I, [2024-05-09T03:58:42.180094 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?shared_buffers *=.*)를 shared_buffers = $db_shared_buffers로 대체
I, [2024-05-09T03:58:42.181568 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?work_mem *=.*)를 work_mem = $db_work_mem으로 대체
I, [2024-05-09T03:58:42.182124 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?default_text_search_config *=.*)를 default_text_search_config = '$db_default_text_search_config'로 대체
I, [2024-05-09T03:58:42.183465 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?checkpoint_segments *=.*)를 checkpoint_segments = $db_checkpoint_segments로 대체
I, [2024-05-09T03:58:42.184221 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?logging_collector *=.*)를 logging_collector = $db_logging_collector로 대체
I, [2024-05-09T03:58:42.198484 #1]  INFO -- : /etc/postgresql/13/main/postgresql.conf에서 (?-mix:#?log_min_duration_statement *=.*)를 log_min_duration_statement = $db_log_min_duration_statement로 대체
I, [2024-05-09T03:58:42.209671 #1]  INFO -- : /etc/postgresql/13/main/pg_hba.conf에서 (?-mix:^#local +replication +postgres +peer$)를 local replication postgres  peer로 대체
I, [2024-05-09T03:58:42.213239 #1]  INFO -- : /etc/postgresql/13/main/pg_hba.conf에서 (?-mix:^host.*all.*all.*127.*$)를 host all all 0.0.0.0/0 md5로 대체
I, [2024-05-09T03:58:42.218935 #1]  INFO -- : /etc/postgresql/13/main/pg_hba.conf에서 (?-mix:^host.*all.*all.*::1\/128.*$)를 host all all ::/0 md5로 대체
I, [2024-05-09T03:58:42.221346 #1]  INFO -- : > [ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres
I, [2024-05-09T03:58:42.404926 #1]  INFO -- : 로케일 생성 중(이 작업에는 시간이 좀 걸릴 수 있습니다)...
생성 완료.
postgres가 이미 실행 중이므로 컨테이너 중지



실패(FAILED)
--------------------
Pups::ExecError: [ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres 실행이 실패했습니다. 반환 코드: #<Process::Status: pid 16 exit 1>
실패 위치: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec가 다음 매개변수로 실행 실패: {"tag"=>"db", "cmd"=>"[ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres"}
bootstrap이 종료 코드 1로 실패
** BOOTSTRAP 실패 ** 이전의 오류 메시지를 확인하려면 위로 스크롤하십시오. 오류가 하나 이상 있을 수 있습니다.
./discourse-doctor가 문제를 진단하는 데 도움이 될 수 있습니다.
902db7e2e5295f896eb00f8379d8507209ddc1844e335ecb403f0cd900502448```

도와주세요. 재빌드조차 할 수 없습니다. app.yml에서 변경한 내용이 사이트에 반영되길 바랄 뿐인데, 사용할 수 있는 RAM의 전체 용량조차 사용하지 못하고 있습니다. shared buffers를 조금 수정했는데 이를 라이브로 적용하고 싶습니다. 그런데 재빌드조차 불가능한 상태입니다. 사이트를 다시 온라인으로 만들기 위해 discourse doctor를 사용하거나 이전 앱을 재시작해야 했습니다.

빌드 중 컨테이너와 통신하는 메인 호스트(또는 다른 위치)에 실행 중인 다른 postgres 인스턴스가 있는 건가요?

아무 아이디어가 없고, 새 서버에 설정을 했기 때문에 그렇게 생각하지 않습니다. 어떤 식으로 중지해야 할까요?
Postgres가 실행 중인지 확인하는 방법을 구글링해서 ‘service postgresql status’ 명령을 실행해 보았는데, 'Unit postgresql.service could not be found’라는 메시지가 반환되었습니다.

심지어 서버를 재부팅해도 여전히 작동하지 않았습니다.

정체되기 전 전체 콘솔 로그

262행에서 잘려 있는 것 같습니다

문제가 여기서 막힙니다. 너무 오래 방치하면 제가 이전 메시지에서 보여드린 것처럼 이런 오류가 나요.

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 {"tag"=>"db", "cmd"=>"[ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres"}
bootstrap failed with exit code 1
** 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.
902db7e2e5295f896eb00f8379d8507209ddc1844e335ecb403f0cd900502448

긴 다운타임을 피하고 싶어서 중지하고 다시 앱을 시작했어요. 답변 주셔서 감사합니다. 어떻게 해야 할지 모르겠어요. 앱을 다시 구축해야 하는 것 같습니다.

RAM + Swap 용량은 얼마인가요? 빌드하기에 충분하지 않을 수 있습니다.

충분히 여유가 있습니다. RAM 40GB, 저장공간 400GB

image
RAM 사용량이 그렇게 많지 않은데, app.yml을 수정해 RAM을 더 많이 사용하도록 설정하고 UNICORN_WORKERS를 25개로 늘렸습니다. (12코어 CPU)

그것은 새로운 에러와 완전히 동일합니까? 새로운 로그를 보면, 해당 명령어들이 이미 실행된 후 크래시가 발생하는 것 같습니다.

네, 그 에러는 ssh 세션을 닫지 않은 채로 실행을 계속했다가 다시 시작했을 때 발생했던 거예요. 실패한다고 알려주는데 14분 정도 걸렸고, 그 뒤에 부트스트랩 에러까지 떴거든요. 긴 다운타임을 원하지 않거든요.

I, [2024-05-09T16:37:04.580910 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2024-05-09T16:37:04.581418 #1]  INFO -- : > [ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres
I, [2024-05-09T16:37:09.576908 #1]  INFO -- : Generating locales (this might take a while)...
Generation complete.
 
I, [2024-05-09T16:37:09.577359 #1]  INFO -- : > 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
I, [2024-05-09T16:37:09.607719 #1]  INFO -- : File > /usr/local/bin/create_db  chmod: +x  chown: 
I, [2024-05-09T16:37:09.635201 #1]  INFO -- : File > /var/lib/postgresql/take-database-backup  chmod: +x  chown: postgres:postgres
I, [2024-05-09T16:37:09.648537 #1]  INFO -- : File > /var/spool/cron/crontabs/postgres  chmod:   chown: 
I, [2024-05-09T16:37:09.648840 #1]  INFO -- : > sleep 5
2024-05-09 16:37:10.726 UTC [34] LOG:  starting PostgreSQL 13.14 (Debian 13.14-1.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

로그 파일의 31~41행에는 이미 postgres가 시작되었음을 나타내는 내용이 포함되어 있습니다.

부트스트랩 오류는 여기에서 다른 행을 보여야 합니다:

해당 행들은 성공적으로 실행된 것으로 보입니다.

솔직히 모르겠어요. rebuild 명령을 실행했는데, 어제 실패한 후에 discourse doctor 명령을 사용해 사이트를 다시 온라인으로 돌렸거든요. 그래도 여전히 재빌드가 안 되고, 매번 같은 줄에서 재빌드가 실패합니다. I, [2024-05-09T16:37:44.902627 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean' warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"

웹 템플릿에 아래 내용을 추가해서 문제를 해결했습니다. 처음에는 첫 번째 댓글의 튜토리얼을 따라갔지만, 저는 초보라서 결국 직접 방법을 찾아냈습니다.

      cd: $home
      cmd:
        - "su discourse -c 'yarn config set network-timeout 600000 -g'"
  - exec:
      cd: $home
      hook: yarn
      cmd:
        - |-
          if [ "$version" != "tests-passed" ]; then
            rm -rf app/assets/javascripts/node_modules
          fi
        - su discourse -c 'yarn install --frozen-lockfile && yarn cache clean

같은 문제를 겪는 다른 사람들을 위해 이렇게 설정해야 합니다.

그리고 인스턴스에 더 많은 RAM을 할당하는 방법은 무엇인가요? 변경 사항을 적용했는데도 여전히 4GB만 사용되고 있습니다. 괜찮은 건가요? 메모리가 실제로 "사용"되고 있는 건가요?

저도 같은 문제(그리고 초보)라서 지금 수정 방법을 시도해 보고 있어요. 올려주셔서 감사합니다.

안녕하세요, 번거롭게 해서 죄송하지만 yarn을 어디에 두어야 할지 찾을 수가 없어요. 어떤 디렉토리에 있어야 하나요?