diff --git a/troubleshooting/251014_skill-rag-file_sshfs_allow_other_해결.md b/troubleshooting/251014_skill-rag-file_sshfs_allow_other_해결.md index 6828266..2a75b58 100644 --- a/troubleshooting/251014_skill-rag-file_sshfs_allow_other_해결.md +++ b/troubleshooting/251014_skill-rag-file_sshfs_allow_other_해결.md @@ -178,39 +178,9 @@ 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 파일시스템의 파일명 길이 제한 -**해결 방안** (커밋 dfe6978): -```python -# 변경 전 (upload.py:80-83) -storage_path = os.path.join(storage_dir, f"{file_hash}_{file.filename}") - -# 변경 후 (upload.py:73-87, 106-107) -doc_id = uuid.uuid4() -storage_path = os.path.join(storage_dir, f"{doc_id}{file_ext}") -document = TeamDocument(id=doc_id, ...) -``` - -**근거**: -- 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 -``` - **구현 완료** (커밋 dfe6978): - ✅ skill-rag-file/app/api/upload.py:73-87,106-107 수정 완료 - ✅ import uuid 추가 (upload.py:5)