This commit is contained in:
Claude-51124 2025-10-15 00:11:39 +09:00
commit 319677af2e

View File

@ -178,40 +178,13 @@ volumes:
- 파일명 예시: `1d8072302cf85eee...pdf` (150자 이상)
**원인**:
- skill-rag-file/app/api/upload.py:82 파일명 생성 로직
```python
storage_path = os.path.join(storage_dir, f"{file_hash}_{file.filename}")
```
- `file_hash` (64자) + `_` + URL인코딩된 한글 파일명 → 150자 초과
- upload.py:82: `f"{file_hash}_{file.filename}"` → 150자 초과
- SSHFS 파일시스템의 파일명 길이 제한
**해결 방안**:
```python
# 변경 전
storage_path = os.path.join(storage_dir, f"{file_hash}_{file.filename}")
# 변경 후
storage_path = os.path.join(storage_dir, f"{document.id}{file_ext}")
```
**근거**:
- DB `TeamDocument.filename`에 원본 파일명 저장됨
- 디스크 파일명은 `document_id`로 고유성 보장
- Slack Lists 업로드 시 DB에서 원본명 조회하여 title 사용
**테스트**:
```bash
# 긴 파일명 쓰기 실패 재현
docker exec skill-rag-file python3 -c "
test_path = '/mnt/51123data/documents/1d8072302cf85eee7413ef6482dc031f57cec3b2e83afe10e4e1955a9397079f_%5B%EA%B3%B5%EB%AC%B8%5D%202025%EB%85%84%20%ED%98%81%EC%8B%A0%EC%86%8C%EC%83%81%EA%B3%B5%EC%9D%B8%20%ED%88%AC%EC%9E%90%EC%A0%9C%EC%95%88%EC%84%9C%20%EA%B2%80%ED%86%A0%EC%9A%94%EC%B2%AD_%28%EC%A3%BC%29%EC%8B%A4%ED%81%AC%EB%A1%9C.pdf'
with open(test_path, 'w') as f: f.write('test')
"
# → OSError: [Errno 74] Bad message
```
**영향 범위**:
- skill-rag-file/app/api/upload.py:80-83 수정 필요
- coldmail workflow PDF 첨부파일 처리 재테스트 필요
**구현 완료** (커밋 dfe6978):
- ✅ skill-rag-file/app/api/upload.py:73-87,106-107 수정 완료
- ✅ import uuid 추가 (upload.py:5)
- ✅ coldmail workflow PDF 첨부파일 재테스트 대기
---