From 32ab3d65f9a974cae55e362f08717e8b3b099c73 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Thu, 28 Aug 2025 16:13:50 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EB=B9=99=20=EB=A0=88=EB=B2=A8=201=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C=20-=20=EC=A0=84=EC=B2=B4=20=ED=94=8C?= =?UTF-8?q?=EB=A1=9C=EC=9A=B0=20=EC=9E=91=EB=8F=99=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../250817_robeing_monitor_integration.md | 21 ++++---- ...appybell80_rb8001_레벨1_표시_문제.md | 50 +++++++++++++++---- .../250825_robeing_stats_display_issue.md | 21 ++++---- 3 files changed, 62 insertions(+), 30 deletions(-) diff --git a/troubleshooting/250817_robeing_monitor_integration.md b/troubleshooting/250817_robeing_monitor_integration.md index 04576ad..2836cc0 100644 --- a/troubleshooting/250817_robeing_monitor_integration.md +++ b/troubleshooting/250817_robeing_monitor_integration.md @@ -66,18 +66,17 @@ 3. **Scopes 파싱 문제**: - PostgreSQL에 문자열로 저장된 scopes를 JSON 배열로 변환 -## 2025-08-28 추가 활용 +## 2025-08-28 활용 결과 -### 로빙 레벨 문제 해결 -- **문제**: rb8001이 하드코딩된 레벨 1 반환 -- **해결**: robeing-monitor의 `/api/stats/{robeing_id}` 활용 -- **필요 작업**: - 1. 51124: state_service를 main.py에 /api 경로로 마운트 - ```python - app.mount("/api", state_service.app) # /healthz 충돌 방지 - ``` - 2. 51123: Gateway에서 로빙 모니터 API 호출로 변경 -- **효과**: DB의 실제 레벨(20) 표시 +### 로빙 레벨 문제 부분 해결 +- **완료**: state_service `/api` 마운트 ✅ +- **완료**: Gateway → robeing-monitor 통합 ✅ +- **완료**: DB 스탯 컬럼 추가 ✅ +- **확인**: 직접 호출 시 레벨 20 반환 ✅ + +### 해결 방법 확인 +- **문제**: Frontend가 `/api/user/robeing` 호출 → 404 +- **해결**: `/api/robeing/info`로 변경 (Gateway에 구현됨) ## 남은 작업 사항 diff --git a/troubleshooting/250823_happybell80_rb8001_레벨1_표시_문제.md b/troubleshooting/250823_happybell80_rb8001_레벨1_표시_문제.md index 85eaf84..d8adb4d 100644 --- a/troubleshooting/250823_happybell80_rb8001_레벨1_표시_문제.md +++ b/troubleshooting/250823_happybell80_rb8001_레벨1_표시_문제.md @@ -1,7 +1,8 @@ # rb8001 레벨 1 표시 문제 해결 -## 작성일: 2025-08-23 +## 작성일: 2025-08-23 (수정: 2025-08-28) ## 작성자: happybell80 with Claude +## 상태: ✅ 해결 완료 --- @@ -115,18 +116,49 @@ if robeing_id == "rb8001" and "stats" in data: --- -## 4. 해결 방안 (2025-08-28 추가) +## 4. 해결 진행 (2025-08-28) -### 로빙 모니터 API 활용 -- **51124 서버**: robeing-monitor (포트 9024) 실행 중 -- **문제**: `/api/stats/{robeing_id}` 엔드포인트가 main.py에 마운트 안됨 -- **해결**: 51124에서 state_service를 main.py에 /api 경로로 마운트 -- **Gateway 수정**: +### 4.1 완료된 작업 ✅ +- **robeing-monitor**: state_service를 `/api` 경로로 마운트 +- **Gateway**: 모든 로빙을 robeing-monitor로 통합 ```python - # rb8001 하드코딩 대신 로빙 모니터 호출 - # state_service가 /api에 마운트됨 + # 조건문 제거, 모든 로빙 통합 target_url = f"http://192.168.219.52:9024/api/stats/{robeing_id}" ``` +- **DB**: robeing_stats에 스탯 컬럼 추가 (memory, compute 등) +- **테스트**: robeing-monitor 직접 호출 시 레벨 20 반환 확인 + +### 4.2 새로운 문제 발견 및 해결 완료 ✅ +**robeing_id가 undefined로 전달됨** +``` +Gateway 로그: +GET /api/stats/undefined HTTP/1.0" 200 OK +GET /api/user/robeing → 404 Not Found +``` + +**원인**: Frontend가 잘못된 엔드포인트 호출 +- 시도: `/api/user/robeing` (없음) +- 실제: `/api/robeing/info` (Gateway에 있음) + +**해결 완료 (로컬 개발자)**: +1. **Gateway**: `/api/robeing/info` JWT 인증 적용 ✅ + ```python + x_user_id: str = Depends(get_verified_user) + ``` +2. **Frontend**: 엔드포인트 변경 ✅ + ```javascript + // 변경 전: /api/user/robeing + // 변경 후: /api/robeing/info + ``` + +### 4.3 최종 플로우 +``` +Frontend (JWT) → Gateway /api/robeing/info → robeing_id 획득 + ↓ + /api/stats/{robeing_id} → robeing-monitor → DB + ↓ + 레벨 20 반환 ✅ +``` --- diff --git a/troubleshooting/250825_robeing_stats_display_issue.md b/troubleshooting/250825_robeing_stats_display_issue.md index e423008..5da7863 100644 --- a/troubleshooting/250825_robeing_stats_display_issue.md +++ b/troubleshooting/250825_robeing_stats_display_issue.md @@ -2,7 +2,7 @@ ## 작성일: 2025-08-25 ## 작성자: 서버 관리자 -## 상태: 미해결 (51124 서버 코드 수정 필요) +## 상태: 부분 해결 (2025-08-28) - robeing_id undefined 문제 남음 --- @@ -165,16 +165,17 @@ useEffect(() => {
💎 {stats?.coins || 0}
``` -### 중기 (51124 서버 수정 필요) +### ✅ 해결 완료 (2025-08-28) -#### 1. ~~rb8001 서비스 수정~~ → 로빙 모니터 활용 (2025-08-28) -- **새 방안**: robeing-monitor API 사용 -- **51124 작업**: state_service를 main.py에 /api 경로로 마운트 (app.mount("/api", state_service.app)) -- **51123 작업**: Gateway에서 로빙 모니터 호출로 변경 - ```python - # state_service가 /api에 마운트됨 - target_url = f"http://192.168.219.52:9024/api/stats/{robeing_id}" - ``` +#### robeing-monitor 활용으로 해결 +- **완료**: state_service를 `/api` 경로로 마운트 +- **완료**: Gateway 모든 로빙 → robeing-monitor 통합 +- **완료**: DB 스탯 컬럼 추가 +- **확인**: 레벨 20 정상 반환 (직접 호출 시) + +#### ✅ 해결 방법: Frontend 엔드포인트 수정 +- 문제: `/api/user/robeing` → 404 +- 해결: `/api/robeing/info`로 변경 (Gateway에 있음) ---