nextcloud / nextcloud/server

Update Exception SQLSTATE 23000 Integrity constraint violation: 1062 Duplicate Key for 'PRIMARY'

Open
#62,381 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: 32bits
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Sorry that I didn't use the bug template but for some reason it didn't want to work on mobile. And I can't write from a desktop at the moment.

Anyways I have the problem where I want to update / recover from Nextcloud 32 to Nextcloud 33.0.6. But when I click on update on the page and it runs through all the query stuff it suddenly gets the following error after all the SQL stuff ran through.

Update Exception SQLSTATE 23000 Integrity constraint violation: 1062 Duplicate Key '...' for 'PRIMARY'

I found the number ... in my database in the jobs scheduling table. When I tried to delete the row and try again the same thing happens.
I'm going to look at it again later and try to give more informations.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Nextcloud 32 to 33.0.6 web updater and the jobs scheduling table described in the report. Reproduce the upgrade with the reported duplicate primary-key condition, then trace the failing database operation; done means identifying the migration or data condition responsible and adding coverage for the failure if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sql
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.