versitygw
versitygw copied to clipboard
Upload failure in posix backend when filesystem is cifs.
The bug Cannot upload files to versitygw when using the posix backend on cifs mounts.
To Reproduce Setup:
$ versitygw posix /mnt/cifs_mount
No IAM service configured, enabling single account mode
┌───────────────────────────────────────────────────┐
│ versitygw │
│ Fiber v2.51.0 │
│ http://127.0.0.1:7070 │
│ (bound on host 0.0.0.0 and port 7070) │
│ │
│ Handlers ............ 25 Processes ........... 1 │
│ Prefork ....... Disabled PID ............. 12345 │
└───────────────────────────────────────────────────┘
Client:
$ aws --endpoint=http://127.0.0.1:7070 s3 mb s3://bucket
make_bucket: bucket
$ aws --endpoint=http://127.0.0.1:7070 s3 cp testfile s3://bucket/testfile
upload failed: ./upload.txt to s3://signage/upload.txt An error occurred (ExistingObjectIsDirectory) when calling the PutObject operation: Existing Object is a directory.
$ ls /mnt/cifs_mount/bucket/
drwxr-xr-x 2 root root 0 Jan 1 00:00 .
drwxr-xr-x 2 root root 0 Jan 1 00:00 ..
drwxr-xr-x 2 root root 0 Jan 1 00:00 .sgwtmp
Server output:
00:00:00 | 200 | 19.209157ms | 127.0.0.1 | PUT | /bucket
00:00:01 | 409 | 111.251961ms | 127.0.0.1 | PUT | /bucket/testfile
Expected behavior Client:
$ aws --endpoint=http://127.0.0.1:7070 s3 cp testfile s3://bucket/testfile
upload: ./testfile to s3://bucket/testfile
$ ls /mnt/cifs_mount/bucket/
drwxr-xr-x 3 root root 4.0K Jan 5 00:00 .
drwxr-xr-x 3 root root 4.0K Jan 2 00:00 ..
drwx------ 2 root root 4.0K Jan 2 00:00 .sgwtmp
-rw------- 1 root root 8 Feb 2 00:00 testfile
Server output:
00:00:00 | 200 | 19.209157ms | 127.0.0.1 | PUT | /bucket
00:00:01 | 200 | 111.251961ms | 127.0.0.1 | PUT | /bucket/testfile
Server Version Version : 0.11 Build : 8b31d6d93c76ef5d2d563047518c1e91b28d38c0 BuildTime: 2023-12-30T05:41:01Z
Additional context Debian 11.7 cifs-utils 2:6.11-3.1+deb11u1 awscli 1.19.1-1 CIFS share from Windows Server 2016