docs: SSHFS 긴 파일명 처리 실패 이슈 추가
- coldmail workflow PDF 업로드 500 에러 원인 파악 - OSError [Errno 74] Bad message: 파일명 길이 제한 - 해결 방안: document_id 기반 파일명으로 변경 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
504bb6f399
commit
1b6a0b3140
@ -168,6 +168,53 @@ volumes:
|
||||
|
||||
---
|
||||
|
||||
## 추가 발견 (2025-10-14 23:30)
|
||||
|
||||
### 문제: SSHFS 긴 파일명 처리 실패
|
||||
|
||||
**증상**:
|
||||
- coldmail workflow 실행 시 PDF 업로드 500 에러
|
||||
- 로그: `OSError: [Errno 74] Bad message`
|
||||
- 파일명 예시: `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자 초과
|
||||
- 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 첨부파일 처리 재테스트 필요
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- 250915_skill-rag-file_Docker_빌드_및_볼륨_마운트_문제.md
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user