Error after restoring data dump "duplicate key violation" when creating new tasks #672

Open
opened 2025-11-01 21:01:34 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @therealmobasha on GitHub (Oct 25, 2025).

Description

Getting this issue after migrating my data from sqlite to postgres. I got everything moved over fine & the app launches & I can view all the tasks just fine. But whenever attempting to create any new tasks, I get an error

"time=2025-10-25T17:35:19.774Z level=ERROR msg="pq: duplicate key value violates unique constraint "tasks_pkey"""

Vikunja Version

latest

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @therealmobasha on GitHub (Oct 25, 2025). ### Description Getting this issue after migrating my data from sqlite to postgres. I got everything moved over fine & the app launches & I can view all the tasks just fine. But whenever attempting to create any new tasks, I get an error "time=2025-10-25T17:35:19.774Z level=ERROR msg="pq: duplicate key value violates unique constraint \"tasks_pkey\""" ### Vikunja Version latest ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@therealmobasha commented on GitHub (Oct 25, 2025):

The first new task I create works just fine because its create pkey=1 which doesnt exist, the following task attempts to be created with pkey=2 which I believe is where the issue occurs because a task with id=2 already exists.

Image
@therealmobasha commented on GitHub (Oct 25, 2025): The first new task I create works just fine because its create pkey=1 which doesnt exist, the following task attempts to be created with pkey=2 which I believe is where the issue occurs because a task with id=2 already exists. <img width="362" height="115" alt="Image" src="https://github.com/user-attachments/assets/a68334a0-5ddf-427a-b91e-e07a1a785ba3" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#672