재구축을 시도하면서 다음과 같은 오류를 처음 겪었습니다.
2022-10-04 14:39:49.780 UTC [1700] FATAL: lock file "postmaster.pid" is empty
2022-10-04 14:39:49.780 UTC [1700] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
힌트는 읽을 수 있지만, 어떻게 진행해야 할지 모르겠습니다. 조언을 주실 수 있나요?
표준 설치 후 ./launcher rebuild app 실행
pfaffman
(Jay Pfaffman)
10월 4, 2022, 3:19오후
4
아마도 다음을 시도해 보세요:
./launcher start app
이전에 이 방법이 작동했나요?
에러인지 경고인지요. 브라우저에서 열어보셨나요?
docker ps
명령어는 어떤 결과를 보여줍니까?
./launcher start app에 대한 응답:
57c2a0746e93
Nothing to do, your container has already started!
그리고 브라우저에서 502 Bad Gateway 오류가 발생합니다.
docker ps 출력
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
57c2a0746e93 local_discourse/app "/sbin/boot" 6 months ago Up 16 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp app
pfaffman
(Jay Pfaffman)
10월 4, 2022, 3:24오후
7
이상하네요. 재부팅하고 다시 빌드해 봐야 할 것 같습니다.
아니면
./launcher stop app; ./launcher rebuild app
지금 실행 중인 컨테이너는 방금 빌드한 것이 아니라 6개월 전에 생성된 오래된 컨테이너입니다.
그리고 리빌드 과정에서 다른 오류가 있었는데你没注意到도 있을 수 있습니다.
같은 결과입니다
2022-10-04 15:26:43.452 UTC [1699] FATAL: lock file "postmaster.pid" is empty
2022-10-04 15:26:43.452 UTC [1699] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
sam
(Sam Saffron)
11월 21, 2022, 1:34오전
9
여기에는 디버깅에 충분한 데이터가 부족합니다.
빌드 프로세스가 PG가 이미 실행 중이라고 판단하고 있기 때문에, PG 업그레이드 프로세스에 문제가 있는 것 같습니다. 무슨 일이 일어나고 있는지 확인하기 위해, 패스워드를 제거한 런처의 전체 로그를 포함해 주실 수 있을까요?
Ed_S
(Ed S)
11월 23, 2022, 5:45오후
10
정상적으로 작동하는 시스템을 살펴보는 것이 도움이 될 수 있습니다. 제 환경에서는 lockfile이 다음과 같이 보입니다:
# ls -l /var/discourse/shared/standalone/postgres_data/postmaster.pid
-rw------- 1 systemd-resolve input 92 Nov 15 16:20 /var/discourse/shared/standalone/postgres_data/postmaster.pid
여기서 11월 15일은 마지막으로 앱을 시작한 날짜입니다. 앱에 진입하면 postgres 프로세스를 확인할 수 있습니다:
# cd /var/discourse/
# ./launcher enter app
x86_64 arch detected.
# ps auxfc|egrep -1 postm
root 45 0.0 0.0 2332 0 ? S Nov15 0:00 \_ svlogd
postgres 48 0.0 0.1 213160 1784 ? S Nov15 0:27 \_ postmaster
postgres 67 0.0 2.6 213380 26924 ? Ss Nov15 0:34 \_ postmaster
postgres 68 0.0 0.4 213292 4236 ? Ss Nov15 0:15 \_ postmaster
postgres 69 0.0 0.1 213160 1068 ? Ss Nov15 3:44 \_ postmaster
postgres 70 0.0 0.1 213840 1520 ? Ss Nov15 0:16 \_ postmaster
postgres 71 0.0 0.0 68184 380 ? Ss Nov15 0:56 \_ postmaster
postgres 72 0.0 0.0 213716 468 ? Ss Nov15 0:00 \_ postmaster
postgres 92 0.0 0.0 225364 324 ? Ss Nov15 0:01 \_ postmaster
postgres 176 0.0 0.1 217944 1484 ? Ss Nov15 0:01 \_ postmaster
postgres 9126 0.0 0.7 215052 7336 ? Ss Nov16 0:19 \_ postmaster
postgres 1574 0.0 5.7 223540 58300 ? Ss 17:28 0:00 \_ postmaster
postgres 1973 0.0 3.3 221032 33960 ? Ss 17:34 0:00 \_ postmaster
postgres 2320 0.1 3.5 218080 36120 ? Ss 17:39 0:00 \_ postmaster
postgres 2321 0.1 2.9 218068 29928 ? Ss 17:39 0:00 \_ postmaster
postgres 2336 0.0 1.4 215052 14340 ? Ss 17:40 0:00 \_ postmaster
# exit
앱을 중지했다면 해당 위치에 lockfile이 없고 postgres 프로세스가 실행되지 않는 것이 정상입니다. (물론 컨테이너가 더 이상 실행되지 않으므로 ps 명령은 호스트에서 직접 실행해야 합니다.)
귀하의 상황에서는 먼저 앱을 중지한 후 postgres 프로세스가 실행되지 않는지 확인하는 것이 좋겠습니다. 서로 충돌하는 두 개의 인스턴스가 실행되고 있을 가능성이 있어 보입니다.
가능성은 낮지만, 디스크가 가득 차서 lockfile이 비어있는 것일 수도 있습니다. 또는 권한 문제일 수도 있습니다.
수정: 컨테이너 내부에서는 lockfile의 위치와 소유자가 다릅니다:
# ./launcher enter app
x86_64 arch detected.
# ls -l /shared/postgres_data/postmaster.pid
-rw------- 1 postgres postgres 92 Nov 15 16:20 /shared/postgres_data/postmaster.pid
# exit
logout
#
Sam이 지적했듯이, 더 많은 정보가 필요합니다.