Cupix::Errors::BadGateway: {"result"=>{"code"=>"BG10004", "type"=>"Cupix::Errors::BadGateway", "reason"=>"Failed to fetc
Service
cupixworks-api
Occurrences
51
Status
Reported
Confidence
85%
Actionability
32%
Cluster ID
626b21cb-cfe0-4fba-8a36-6b4b36eb8562
First Seen
2025-11-28 05:45 UTC
Last Seen
2026-07-28 11:08 UTC
Actions
Cupix::Errors::BadGateway: {"result"=>{"code"=>"BG10004", "type"=>"Cupix::Errors::BadGateway", "reason"=>"Failed to fetc
What Happened#
Facility migration 요청 처리 중 migration-service(cupixworks monorepo)가 tesla API(GET /api/v1/facilities/{id})를 호출해 source/destination facility 정보를 가져오려다 tesla 가 401 Unauthorized 를 반환했다. migration-service 는 이 401 을 Cupix::Errors::BadGateway(code BG10004)로 감싸 502 로 응답하고 error 레벨 로그를 남긴다. 2025-11-28 부터 2026-07-28 까지 약 8개월간 51건이 산발적으로 발생했다.
APM service 필드는 cupixworks-api 로 기록되어 있으나, 에러 메시지("Failed to fetch facility info from tesla server")와 code BG10004 문자열은 tesla 가 아니라 tesla 를 호출하는 migration-service 에서 발생한 것이다.
Quick Facts#
| Field | Value |
|---|---|
| exception.class | Cupix::Errors::BadGateway |
| exception.message | Unable to retrieve facility info: 401 Unauthorized |
| top_frame | applications/migration-service/app/factories/migration_factory.rb:174-180 |
| runtime | Ruby (Rails, cupixworks migration-service) |
| env | production (cross-environment facility migration flow) |
Affected Teams#
| Team / Domain | Error Count | Impact |
|---|---|---|
| migration-service (facility migration) | 51 (8개월 누적) | facility migration 요청이 502 로 실패. 만료/무효 토큰으로 재시도한 소수 사용자에 국한 |
Timeline#
- 2025-11-28 14:45 KST — 최초 발생 (first_seen, representative sample)
- 2026-07-28 20:08 KST — 최근 발생 (last_seen)
- 2026-08-04 — RCA 수행
Scoring#
Confidence 85% · Actionability 32%
Confidence#
| Dimension | Score | Detail |
|---|---|---|
| Evidence completeness | 5/5 | 17 code refs, 4 log queries |
| Code path explicitness | 3/3 | 17 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 | 1/5 | critical |
| Affected files | 1/5 | 11 file(s) |
| Single repo | 1/3 | 5 service(s) |
| Immediate actions | 0/3 | absent |
| Testability | 2/3 | test mentioned |
| External dependency | 3/3 | no external deps |
| Data migration | 0/3 | migration needed |