0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-05 22:40:53 +00:00
nextcloud_server/lib/private/Files/ObjectStore
Louis Chemineau 2e3cffa473 fix: Transfer ownership with S3 as primary
When using S3 as primary storage, transferring ownership with the `--move` option fail with the following error:

`SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-45b963397aa40d4a0063e0d85e4fe7a1' for key 'fs_storage_path_hash'`

The `--move` option moves the entire home folder from one account to another.
The error means that the move failed because the destination folder already exist in `oc_filecache`.

- With S3 as primary storage, folders only exists as entries in `oc_filecache`.
- With S3 as primary storage, `moveFromStorage(...)` only moves the cache entry, as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder.
- With Local storage, `moveFromStorage(...)` calls `rename(...)` which delete pre-existing folder.

- `transfer(...)`: 687a4d9ac7/apps/files/lib/Service/OwnershipTransferService.php (L112)
- `oneTimeUserSetup(...)`: 687a4d9ac7/lib/private/Files/SetupManager.php (L261-L262)
- `mkdir(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L91-L135)
- `moveFromStorage(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L635-L636)

Delete pre-existing folder in `moveFromStorage(...)`

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-14 14:14:58 +00:00
..
AppdataPreviewObjectStoreStorage.php refactor(objectstorage): cleanup types 2024-02-02 14:59:21 +01:00
Azure.php fix: Apply new coding standard to all files 2024-04-04 11:45:22 +02:00
HomeObjectStoreStorage.php refactor(objectstorage): cleanup types 2024-02-02 14:59:21 +01:00
Mapper.php Implement multibucket shift for ObjectStore 2021-11-11 15:09:28 +01:00
ObjectStoreScanner.php perf(files): faster query to fetch incomplete directories 2025-02-14 11:00:07 +01:00
ObjectStoreStorage.php fix: Transfer ownership with S3 as primary 2025-04-14 14:14:58 +00:00
S3.php fix(s3): add SSE-C parameters to headObject call 2023-07-30 22:54:58 +02:00
S3ConfigTrait.php fix(S3ConfigTrait): Allow proxy field to take false 2024-09-15 17:18:15 +00:00
S3ConnectionTrait.php fix(s3): treat empty sse_c_key as not set 2025-01-29 17:33:42 +00:00
S3ObjectTrait.php fix: Apply new coding standard to all files 2024-04-04 11:45:22 +02:00
S3Signature.php Refactors "strpos" calls in lib/private to improve code readability. 2023-05-15 15:17:19 +03:30
StorageObjectStore.php fix: fix object store id for test object store 2024-09-19 17:44:41 +02:00
Swift.php fix: Apply new coding standard to all files 2024-04-04 11:45:22 +02:00
SwiftFactory.php fix: make swift connect exception message more informative 2024-09-10 14:46:21 +00:00
SwiftV2CachingAuthService.php Update php licenses 2021-06-04 22:02:41 +02:00