From 1bb1c9bbf56958ab8b7b05b983de4dca1c0c3955 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 25 Aug 2025 23:03:45 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20State=20Service=20DB=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=98=A4=EB=A5=98=20=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 5433 포트는 SSH 터널용 포트임을 명시 - 문제는 포트가 아니라 DB 이름 (auth_db → main_db) - SSH 터널 확인 명령어 추가 - 51124:5433 → 51123:5432 터널 설명 추가 --- ...0825_gmail_token_null_daily_briefing_fix.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/troubleshooting/250825_gmail_token_null_daily_briefing_fix.md b/troubleshooting/250825_gmail_token_null_daily_briefing_fix.md index 6176614..00f3e17 100644 --- a/troubleshooting/250825_gmail_token_null_daily_briefing_fix.md +++ b/troubleshooting/250825_gmail_token_null_daily_briefing_fix.md @@ -220,7 +220,7 @@ sequenceDiagram RB->>State: POST /api/logs/rb8001/conversation State->>PG: INSERT INTO conversation_logs
❌ DB 연결 실패 - Note over State,PG: 잘못된 DB 설정:
localhost:5433/auth_db + Note over State,PG: 잘못된 DB 이름:
localhost:5433/auth_db
(main_db여야 함) State-->>RB: 500 Internal Server Error Note over RB: 에러 로깅만,
서비스 계속 동작 @@ -229,18 +229,24 @@ sequenceDiagram ### 7.3 근본 원인 **State Service 환경변수 오류**: ```bash -# 현재 (잘못된 설정) +# 현재 (잘못된 DB 이름) DATABASE_URL=postgresql://robeings:robeings@localhost:5433/auth_db +# 문제: auth_db가 존재하지 않음 (main_db 사용해야 함) -# 올바른 설정 -DATABASE_URL=postgresql://robeings:robeings@192.168.219.45:5432/main_db +# 올바른 설정 (SSH 터널 사용) +DATABASE_URL=postgresql://robeings:robeings@localhost:5433/main_db +# 5433은 SSH 터널 포트 (51124:5433 → 51123:5432) ``` ### 7.4 해결 방법 ```bash -# State Service 환경변수 수정 (51124 서버) +# 1. SSH 터널 확인 (51124 서버) +ps aux | grep "5433:localhost:5432" +# 없으면 생성: ssh -N -L 5433:localhost:5432 admin@192.168.219.45 & + +# 2. State Service 환경변수 수정 (51124 서버) cd /home/heejae/robeing-state-service -vim .env # DATABASE_URL 수정 +vim .env # auth_db → main_db로 수정 docker compose down && docker compose up -d --build ```