nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.5k stars 4.08k forks source link

[Bug]: ERROR: duplicate key value violates unique constraint "fs_storage_path_hash" #41319

Open tobiasKaminsky opened 1 year ago

tobiasKaminsky commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

Using AIO, with 27.1.0.7 Seeing:

2023-11-07 08:03:46.639 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.639 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, c3d74eff1486eadc1589bf4c7f3d3c36) already exists.
2023-11-07 08:03:46.639 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-11-07 08:03:46.642 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.642 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, 946a8b60665758d00a25d56c30db6f09) already exists.
2023-11-07 08:03:46.642 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-11-07 08:03:46.645 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.645 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, 971bc299fe96732c655262821634af17) already exists.
2023-11-07 08:03:46.645 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-11-07 08:03:46.648 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.648 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, 879cbeb279c9a99ac9e8e7370b8d2cc7) already exists.
2023-11-07 08:03:46.648 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-11-07 08:03:46.650 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.650 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, 4a0420a8cad471bac8f24c6d58bab16d) already exists.
2023-11-07 08:03:46.650 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-11-07 08:03:46.654 UTC [20963] ERROR:  duplicate key value violates unique constraint "fs_storage_path_hash"
2023-11-07 08:03:46.654 UTC [20963] DETAIL:  Key (storage, path_hash)=(3, 903b9080f3f3a897c56ed063347b143c) already exists.
2023-11-07 08:03:46.654 UTC [20963] STATEMENT:  INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)

Steps to reproduce

  1. just using NC

Expected behavior

No errors

Installation method

None

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

Very little info possible. If you need anything, please write :)

tobiasKaminsky commented 1 year ago

Might be similar to https://github.com/nextcloud/server/issues/19494, but is different table and different constraint.

szaimen commented 1 year ago

Cc @icewind1991 @Altahrim

kesselb commented 1 year ago

Duplicate of https://github.com/nextcloud/server/issues/37392?