Error Codes Wiki

HTTP 409 Conflict — What It Means & How to Fix It

Error4xx client error

Overview

The HTTP 409 Conflict status code indicates the request conflicts with the current state of the server, such as an edit conflict or duplicate resource.

Key Details

  • This status code is used when the request cannot be completed due to a conflict with the resource state.
  • Common in PUT requests where optimistic concurrency control detects a conflict.
  • The response should include information about the conflict to help the client resolve it.
  • It is often used to prevent duplicate resource creation.

Common Causes

  • Two users edited the same resource simultaneously (edit conflict).
  • Attempting to create a resource that already exists.
  • Version mismatch in optimistic locking where the resource was modified by another request.
  • State transition conflicts, such as trying to publish an already published document.

Steps

  1. 1Read the response body for details about the conflict.
  2. 2Fetch the latest version of the resource to see the current state.
  3. 3Merge your changes with the current state and retry.
  4. 4If creating a resource, check if it already exists first.
  5. 5Implement retry logic with conflict resolution for concurrent operations.

Tags

httpclient-errorconflictconcurrencyduplicate

Related Items

More in 4xx Client Error

Frequently Asked Questions

It means the request conflicts with the current state of the resource. This often happens when two users try to edit the same resource simultaneously.