# 로그인 후 사용자별 502 오류 발생 — DiscourseUpdates.has\_unseen\_features?로 원인 확인

**URL:** https://meta.discourse.org/t/user-specific-502-errors-after-login-traced-to-discourseupdates-has-unseen-features/394612
**Category:** Support
**Tags:** nginx, login, users
**Created:** [1월 28, 2026, 11:13오후 UTC](https://meta.discourse.org/t/user-specific-502-errors-after-login-traced-to-discourseupdates-has-unseen-features/394612 "2026-01-28T23:13:42Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![kkurdupov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kkurdupov/32/191014_2.png) [@kkurdupov](https://meta.discourse.org/u/kkurdupov)
#### Post date: [4월 16, 2026, 8:37오전 UTC](https://meta.discourse.org/t/user-specific-502-errors-after-login-traced-to-discourseupdates-has-unseen-features/394612/4 "2026-04-16T08:37:33Z")

</div>

저희도 동일한 문제를 겪었고, 원인을 더 깊이 추적해 보았습니다.

근본 원인은 `DiscourseUpdates.has_unseen_features?`가 `GitUtils.has_commit?`를 호출하고, 이 함수가 다음을 실행하기 때문입니다:

```bash
git merge-base --is-ancestor <sha> HEAD

```

새로운 Discourse Docker 이미지에서는 컨테이너 내부의 저장소가 \*\*promisor remote를 사용하는 부분 클론(partial clone)\*\*으로 설정되어 있습니다. 기능 SHA가 로컬에 존재하지 않는 경우, Git은 원격에서 지연 로드(lazy fetch)를 시도하며(`upload-pack`), 이 과정에서 호출당 약 3~4초가 소요됩니다.

여러 기능이 검사되므로 요청 시간이 30초 이상 걸리게 되며, 특히 이 검사가 실행되는 스태프 사용자의 경우 결국 502(Unicorn 타임아웃) 오류가 발생합니다.

주요 사항:

- 스태프에게만 발생함(`CurrentUserSerializer`를 통해)

- 부분 클론에서 커밋이 누락되어 발생함

- 누락된 객체에 대한 Git 작업이 느린 원격 조회를 유발함

- 컨테이너 내부에서 `git merge-base --is-ancestor <missing_sha> HEAD`로 재현 가능

간단한 완화 방안은 `GitUtils.has_commit?` 결과를 캐싱하는 것입니다(예: HEAD+SHA별로). 이를 통해 반복되는 비용이 높은 git 호출을 방지할 수 있습니다.

---

_[View the full topic](https://meta.discourse.org/t/user-specific-502-errors-after-login-traced-to-discourseupdates-has-unseen-features/394612)._
