Skip to content

postgres error: duplicate key value violates unique constraint "email_hash_pkey" #15451

@ntlspck

Description

@ntlspck
  • Gitea version (or commit ref): v1.13.7 built with GNU Make 4.3, go1.16.3
  • Git version: 2.26.3
  • Operating system: Raspbian GNU/Linux 10, docker kunde21/gitea-arm v1.13.7-armv7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No

Description

I already opened #14725 and also referring to #12577 and #12287
These issues are closed and a fix released, but it still doesn't fix my duplicate key violation errors.

Using gitea 1.13.7 and postgres 13.0 showing the following reoccuring errors:

2021-04-13 10:06:38.184 UTC [32] ERROR: duplicate key value violates unique constraint "email_hash_pkey"
2021-04-13 10:06:38.184 UTC [32] DETAIL: Key (hash)=(xxxxxxxxxxxxxxxxxxxx) already exists.
2021-04-13 10:06:38.184 UTC [32] STATEMENT: INSERT INTO "email_hash" ("hash","email") VALUES ($1,$2)

Schema Name Type
public email_address table
public email_address_id_seq sequence
public email_hash table

What somebody from previous tickets told me to do, but won't fix the duplicate key violation:

  • gitea doctor recreate-table
  • updating sequences (although email_hash has no sequence! so this suggestion makes no sense)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions