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

Upload failure in posix backend when filesystem is cifs. #392

Closed
rhamon opened this issue Feb 5, 2024 · 5 comments
Closed

Upload failure in posix backend when filesystem is cifs. #392

rhamon opened this issue Feb 5, 2024 · 5 comments
Labels
bug Something isn't working posix issue relates to posix backend

Comments

@rhamon
Copy link

rhamon commented Feb 5, 2024

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 : 8b31d6d
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

@rhamon rhamon added the bug Something isn't working label Feb 5, 2024
@benmcclelland
Copy link
Member

@rhamon I just tested against a redhat samba server mounted with cifs on a redhat client, and this looks to work ok. I can try to setup the debian system to reproduce, but I wanted to check the cifs mount options to see if maybe my tests are different somehow. Can you check to see if there are any options set from mount | grep cifs_mount that might be relevant to these tests?

The error "ExistingObjectIsDirectory" generally means that you are trying to upload an object, but there is already a directory with this name that exists server side. I'm not seeing this in the ls output, so likely is some gateway bug but I wanted to double check that /mnt/cifs_mount/bucket/testfile is not showing up as a directory at any time during this test.

@benmcclelland benmcclelland added the posix issue relates to posix backend label Feb 7, 2024
@benmcclelland
Copy link
Member

Closing this as we are not able to reproduce. Can open again if we have more specifics about whats needed to reproduce this.

@benmcclelland benmcclelland closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
@rhamon
Copy link
Author

rhamon commented Jun 6, 2024

I haven't tested with a Samba share on Redhat but I would assume Samba is different in features to a Microsoft Windows Server.
My test was done mouting a MS Windows Server 2016 shared folder to a Debian 11 server running Versity 0.11.
I can test the latest version of Versity on a Redhat type OS instead of Debian but the share has to come from a MS Windows Server for my use case.

@rhamon
Copy link
Author

rhamon commented Jun 6, 2024

The mount looked like this during the initial report:
//Win2k16/share/ on /mnt/cifs_mount type cifs (rw,relatime,vers=3.0,cache=strict,uid=0,noforceuid,gid=0,noforcegid,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=0)

@rhamon
Copy link
Author

rhamon commented Jun 6, 2024

I'm also not able to reproduce the initial issue with the latest version of versitygw on both Debian and Redhat.
Thanks and we can keep this closed.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working posix issue relates to posix backend
Projects
None yet
Development

No branches or pull requests

2 participants