docs: add gitea 502 incident report (2026-03-06)

This commit is contained in:
happybell80 2026-03-06 19:26:50 +09:00
parent 9caa3ab4b7
commit 41bf0135e1

View File

@ -0,0 +1,39 @@
# 51123 Gitea LFS 권한 오류로 인한 git.ro-being.com 502 복구
**날짜**: 2026-03-06
**작성자**: admin
**관련 파일**: `/etc/gitea/app.ini`, `/etc/nginx/sites-enabled/default`
---
## 문제 상황
- 2026-03-06 19:04 KST 전후 `https://git.ro-being.com/` 접속 시 `HTTP/2 502` 발생.
- nginx는 `git.ro-being.com``http://localhost:3000/`으로 프록시 중이었고, upstream인 gitea가 비정상 상태였음.
## 원인 확인
1. 서비스 상태
- `systemctl status gitea`에서 `failed (Result: exit-code)` 확인.
2. gitea 로그
- `journalctl -u gitea`에서 아래 치명 오류 반복 확인:
- `storage.Init failed: mkdir /mnt/nas/gitea-lfs: permission denied`
- 19:04:28~19:04:31 KST 사이 재시작 반복 후 `Failed to start Gitea` 상태 진입.
3. 설정 경로
- `/etc/gitea/app.ini`에서 LFS 저장 경로가 `/mnt/nas/gitea-lfs`로 설정됨.
## 복구 상태 확인
- 2026-03-06 19:21:08 KST: `Started Gitea` 로그 확인.
- 현재 `gitea.service``active (running)` 상태.
- 외부 검증: `curl -I https://git.ro-being.com/` 결과 `HTTP/2 200`.
## 추가 관찰 사항
- 현재 시점 확인 결과:
- `/mnt/nas``findmnt /mnt/nas` 기준 `not-mounted`
- 디렉터리 권한은 `/mnt/nas`(root:root), `/mnt/nas/gitea-lfs`(git:git) 상태
- 즉, gitea는 현재 경로 접근은 가능하지만 NAS 마운트 상태와 실제 저장 위치 일치 여부는 별도 운영 점검이 필요함.
## 교훈
- Gitea LFS가 NAS 경로를 사용하면, 서비스 기동 전 `마운트 상태 + 대상 디렉터리 소유권`이 동시에 만족되어야 함.
- `502`만 보고 nginx 문제로 단정하면 오판 가능성이 높고, 반드시 `nginx(upstream) + systemd(gitea) + journal`을 같은 시각대로 교차 확인해야 함.
- 스토리지 경로가 마운트 의존일 때는 마운트 해제/권한 변동 감시를 운영 체크리스트에 포함해야 함.