tool::http-status-detail
409 Conflict
The request conflicts with the current state of the server.
상태 코드
409
이름
Conflict
카테고리
4xx상세 설명
HTTP 409 Conflict는 요청이 서버의 현재 상태와 충돌하여 처리할 수 없음을 나타냅니다. 동일한 리소스를 동시에 수정하거나, 중복된 데이터를 생성하거나, 버전이 맞지 않는 업데이트를 시도할 때 발생합니다. REST API에서 낙관적 잠금(Optimistic Locking) 구현에 자주 사용됩니다.
주요 원인
- ▸이미 존재하는 사용자명이나 이메일로 계정 생성 시도
- ▸낙관적 잠금 실패 (ETag 불일치로 인한 버전 충돌)
- ▸동시 편집으로 인한 데이터 충돌 발생
- ▸부모 리소스 없이 자식 리소스 생성 시도
해결 방법
- 1.충돌하는 리소스를 먼저 조회하여 현재 상태를 확인하세요
- 2.ETag 기반 낙관적 잠금이라면 최신 버전으로 업데이트 후 재시도하세요
- 3.중복 키 충돌이면 기존 데이터를 업데이트하는 방향으로 변경하세요
- 4.응답 본문에서 충돌의 구체적인 원인을 확인하세요
관련 HTTP 헤더
Content-TypeETag응답 예시
HTTP/1.1 409 Conflict
Content-Type: application/json
{"error":"conflict","message":"Username 'john_doe' already exists"}관련 상태 코드
400Bad RequestThe server could not understand the request due to invalid syntax.→401UnauthorizedAuthentication is required and has failed or not been provided.→402Payment RequiredReserved for future use; some services use it for payment walls.→403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).→404Not FoundThe requested resource could not be found.→
ad · 300×250
// related tools