docs: Slack 봇 설치 workspace_id 컬럼 오류 트러블슈팅
문제: workspace_member 테이블에 존재하지 않는 workspace_id 컬럼 조회 시도 원인: DB 스키마 변경 후 slack.py:408-413 쿼리 미반영 해결: user.team_id 직접 조회로 수정 필요 (로컬 개발자) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0be1548ccc
commit
1068b3d0a2
54
troubleshooting/251015_slack_install_workspace_id_error.md
Normal file
54
troubleshooting/251015_slack_install_workspace_id_error.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Slack 봇 설치 workspace_id 컬럼 오류
|
||||
|
||||
**날짜**: 2025-10-15
|
||||
**작성자**: 51123 서버 관리자
|
||||
**관련 파일**: `auth-server/app/providers/slack.py:408-418`
|
||||
|
||||
---
|
||||
|
||||
## 문제 상황
|
||||
|
||||
Slack 연동 버튼 클릭 시 Internal Server Error:
|
||||
```
|
||||
column "workspace_id" does not exist
|
||||
LINE 2: SELECT workspace_id
|
||||
FROM workspace_member
|
||||
```
|
||||
|
||||
**에러 로그**: auth-server 로그에서 sqlalchemy.exc.ProgrammingError 확인
|
||||
|
||||
## 원인 분석
|
||||
|
||||
### DB 구조
|
||||
- workspace_member 테이블: workspace_id 컬럼 없음 (id, user_id, role, is_active만 존재)
|
||||
- slack.py:408-413: 존재하지 않는 컬럼 조회 시도
|
||||
|
||||
### 실제 관계
|
||||
- user.team_id → team.id
|
||||
- Workspace = Team (workspace.py:113)
|
||||
- user.team_id가 workspace_id 역할
|
||||
|
||||
## 해결 방안
|
||||
|
||||
**로컬 개발자 수정 필요**: slack.py:407-423
|
||||
|
||||
- slack.py:408-413: workspace_member 쿼리 제거
|
||||
- user.team_id 직접 조회로 변경
|
||||
- User 모델 import 추가 필요 (app.models.user)
|
||||
|
||||
## 교훈
|
||||
|
||||
### DB 스키마 검증 누락
|
||||
- workspace_member.workspace_id 존재 가정
|
||||
- 실제 테이블 구조 미확인
|
||||
- 교훈: 쿼리 작성 전 \d 명령으로 테이블 구조 확인 필수
|
||||
|
||||
### 스키마 변경 후 코드 미반영
|
||||
- Git 히스토리: 9월 workspace 관련 수정 다수 (커밋 455af87, 59ae0ab)
|
||||
- DB 스키마 변경 후 참조 쿼리 미검증
|
||||
- 교훈: 스키마 변경 시 Grep으로 전체 참조 검색 후 일괄 수정
|
||||
|
||||
### 중간 테이블 설계 오류
|
||||
- workspace_member에 workspace/team FK 누락
|
||||
- user.team_id로 직접 조회해야 하는 구조
|
||||
- 교훈: 다대다 중간 테이블은 양쪽 FK 필수
|
||||
Loading…
x
Reference in New Issue
Block a user