ES /docs

GET 502 (avg 50660ms, max 50815ms)

Service
cupixworks-api
Occurrences
2
Status
Reported
Confidence
85%
Actionability
32%
Cluster ID
6150ecb2-d87d-428f-ab21-3da15600bc07
First Seen
2026-06-16 19:42 UTC
Last Seen
2026-06-16 19:42 UTC
Actions

GET 502 (avg 50660ms, max 50815ms)

What Happened#

2026-06-17 04:42 KST 무렵 production-us-west-2 의 cupixworks-api 에서 인증 미들웨어가 모든 요청마다 발급하는 UPDATE users SET first_sign_in_at = ? 쿼리가 동일한 user row 에 대한 row lock 대기로 50초간 hang 되어 InnoDB lock wait timeout (~50s) 에 걸렸다. Puma 가 응답을 만들지 못한 사이 Elastic Beanstalk/ALB 가 idle/upstream timeout 으로 502 를 반환했고, APM 은 이 요청들을 resource_name: GET 502 로 묶었다. 같은 사용자 세션에서 병렬로 떠난 두 건의 GET /api/v1/sessions?fields= 가 서로 같은 row 를 잠그며 동시에 timeout 됐다.

Quick Facts#

Field Value
exception.class ActiveRecord::LockWaitTimeout (root: Mysql2::Error::TimeoutError)
exception.message Lock wait timeout exceeded; try restarting transaction
top_frame lib/cupix/auth/verification.rb:125 (deployed copy reports :129)
runtime Ruby 3.3.0, Rails 7.2.2, mysql2 0.5.4, puma 6.5.0, datadog 2.11.0
deploy production-us-west-2-20260616t0541z0-9443a6d8-cupixworks (host i-09eb846280d67ac02), production-us-west-2-20260616t0136z0-9443a6d8-cupixworks (host i-0a026d499fb305739)
env production / us-west-2 (Elastic Beanstalk tesla-prod)
route GET /api/v1/sessionsApi::V1::SessionsController#show

Affected Teams#

Team / Domain Error Count Impact
cupixworks-api (auth/session) 2 traces 동일 user 가 발급한 동시 인증 요청이 502 로 끊김. 같은 패턴이 발생할 때마다 모든 cupixworks-api 인증 트래픽이 영향 가능 (모든 인증 컨트롤러가 동일한 before_action :authenticate! 경로를 사용).

Timeline#

  1. 2026-06-17 04:42:29 KST — host i-0a026d499fb305739 에서 GET /api/v1/sessions?fields= 시작 (trace 1083198673863158736).
  2. 2026-06-17 04:42:37 KST — host i-09eb846280d67ac02 에서 두 번째 GET /api/v1/sessions?fields= 시작 (trace 3060560276632410961). 동일 user row 에 BEGIN + UPDATE 진입.
  3. 2026-06-17 04:42:37 KST (+0ms) — 두 트랜잭션 모두 같은 row 의 X-lock 을 요청. 첫 트랜잭션이 잡고 두 번째가 대기 시작.
  4. 2026-06-17 04:43:28 KST (~50.5s 뒤) — 두 UPDATE 모두 InnoDB innodb_lock_wait_timeout (50s) 으로 종료, ROLLBACK. Puma 는 5xx 응답 직전이지만 이미 ALB 가 502 로 응답을 끊어 resource_name: GET 502 로 분류됨.
  5. 2026-06-17 04:43:28 KST 직후 — 후속 요청은 정상 (/api/v1/sessions 200 로그가 04:42:39 KST 부터 다수 관찰).

Scoring#

Confidence 85% · Actionability 32%

Confidence#

Dimension Score Detail
Evidence completeness 5/5 28 code refs, 8 log queries
Code path explicitness 3/3 28 file:line refs
Log evidence 3/3 section, query, pattern
RCA structure 3/3 3/3 sections
Revision history 0/3 0 revision(s)
Agent execution 3/3 success

Actionability#

Dimension Score Detail
Fix complexity 5/5 trivial
Affected files 1/5 49 file(s)
Single repo 1/3 5 service(s)
Immediate actions 0/3 absent
Testability 0/3 no test info
External dependency 1/3 external deps found
Data migration 0/3 migration needed