Already exists
The command would create something that is already there.
Why it happens
- An idempotency key was reused for another operation, or for the same one with different arguments. This is the only way the runtime itself raises this code.
- A create command for an id, name or other unique value that is taken.
What to do
- Use a fresh key for each distinct command. A key names one command with one set of arguments, so a replay answers the request that was sent.
- Read the existing item instead, or choose another value.
What it looks like
Inside a batch, the operation's frame carries it:
json
{
"id": 1,
"error": {
"code": "already_exists",
"message": "A user named ada already exists"
},
"fin": true
}retryable appears only where it differs from the code's default, which is the one at the top of this page.
When the whole request is refused over HTTP, the answer is a problem document:
json
{
"type": "https://eddyboutros.github.io/rayfold/errors/already_exists",
"title": "already exists",
"status": 409,
"detail": "A user named ada already exists",
"code": "already_exists"
}See also all error types and the errors chapter of the specification.