#13333·weaviate

createBackup returns 500 instead of 422 for a duplicate base-backup ID

Author: avanish-gargCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbugcommunity

How to reproduce this bug?

  1. POST /v1/backups/{backend} with a body where id equals incrementalBaseBackupId (i.e. a backup incrementally based on itself), e.g. {"id": "same-id", "incrementalBaseBackupId": "same-id"}.
  2. Observe the response is 500 Internal Server Error.

What is the expected behavior?

A client input validation error like this should return 422 Unprocessable Entity, matching how createBackup already handles the identically-shaped backup.ErrUnprocessable case a few lines below in the same function (adapters/handlers/rest/handlers_backup.go).

What is the actual behavior?

createBackup's own duplicate-ID guard returns backups.NewBackupsCreateInternalServerError() for this case — a genuine 500, indistinguishable from an actual server fault, even though nothing went wrong server-side; the request body itself is invalid.

Supporting information

go
// adapters/handlers/rest/handlers_backup.go
if params.Body.ID == baseBackupID {
    return backups.NewBackupsCreateInternalServerError().
        WithPayload(errPayloadFromSingleErr(principal, fmt.Errorf("base backup cannot be the same as the new backup ID: %s", baseBackupID)))
}

Server Version

main branch, post-v1.39.3 (commit 5a39c0cfc1)

Weaviate Setup

Single Node

Nodes count

No response

Code of Conduct