Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database: Duplicate key value violates unique constraint "fce_fileid_idx" #1202

Closed
jokay opened this issue Aug 18, 2020 · 3 comments
Closed

Comments

@jokay
Copy link

jokay commented Aug 18, 2020

We got some of theses error logs regarding unique constraint violations:

2020-08-18 12:34:16.231 CEST [53] ERROR:  duplicate key value violates unique constraint "fce_fileid_idx"
2020-08-18 12:34:16.231 CEST [53] DETAIL:  Key (fileid)=(125027) already exists.
2020-08-18 12:34:16.231 CEST [53] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)
2020-08-18 12:34:23.706 CEST [57] ERROR:  duplicate key value violates unique constraint "fce_fileid_idx"
2020-08-18 12:34:23.706 CEST [57] DETAIL:  Key (fileid)=(125044) already exists.
2020-08-18 12:34:23.706 CEST [57] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)
2020-08-18 12:39:15.805 CEST [153] ERROR:  duplicate key value violates unique constraint "fce_fileid_idx"
2020-08-18 12:39:15.805 CEST [153] DETAIL:  Key (fileid)=(125027) already exists.
2020-08-18 12:39:15.805 CEST [153] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)
2020-08-18 12:39:22.921 CEST [157] ERROR:  duplicate key value violates unique constraint "fce_fileid_idx"
2020-08-18 12:39:22.921 CEST [157] DETAIL:  Key (fileid)=(125044) already exists.
2020-08-18 12:39:22.921 CEST [157] STATEMENT:  INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2)

Our setup:

  • fpm (nextcloud:19-fpm-alpine) 19.0.1
  • web (nginx:stable-alpine) 1.18.0
  • db (postgres:12-alpine) 12.4
  • redis (redis:alpine) 6.0.6

Is there any maintenance routine or data integrity check which can be run using the occ (which may be able to fix the errors)?

@jokay
Copy link
Author

jokay commented Aug 18, 2020

May be related to nextcloud/server#19494.

@jokay
Copy link
Author

jokay commented Aug 18, 2020

Already executed the following commands:

./occ files:cleanup

0 orphaned file cache entries deleted
./occ files:scan --all

+---------+--------+--------------+
| Folders | Files  | Elapsed time |
+---------+--------+--------------+
| 25405   | 389373 | 00:11:02     |
+---------+--------+--------------+
./occ maintenance:repair

 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Fix potential broken mount points
     - No mounts updated
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - SCSS cache cleared
     - JS cache cleared
 - Clear every generated avatar on major updates
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Update name of the stored view
 - Fix component of birthday calendars
     - 9 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Repair step already executed
 - Fix broken values of calendar objects
    0 [->--------------------------]
 - Registering building of calendar search index as background job
     - Repair step already executed
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background job
     - Repair step already executed
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 cached events without a calendar subscription have been cleaned up
     - 0 changes without a calendar subscription have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
 - Update OAuth token expiration times
 - Add background job to check for backup codes
 - Populating added database structures for workflows

@J0WI
Copy link
Contributor

J0WI commented Nov 13, 2020

This is not related to the Docker image. Closing as duplicate of nextcloud/server#19494

@J0WI J0WI closed this as completed Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants