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

Insert SSE headers when appropriate #2228

Merged
merged 1 commit into from
Jul 23, 2023
Merged

Insert SSE headers when appropriate #2228

merged 1 commit into from
Jul 23, 2023

Conversation

gaul
Copy link
Member

@gaul gaul commented Jul 22, 2023

References #2218. References #2227.

@gaul gaul requested a review from ggtakec July 22, 2023 14:14
@gaul
Copy link
Member Author

gaul commented Jul 22, 2023

@icassassin could you test to see if this resolves your symptoms?

@icassassin
Copy link

icassassin commented Jul 22, 2023

Seems to still be doing the same thing.

s3fs --version:
Amazon Simple Storage Service File System V1.93 (commit:36dda16) with OpenSSL

Test:
Two simple operations. 'touch test.txt' to create a file in the bucket, and then 'mv test.txt asdf.txt' to test renaming.
'touch test.txt' successfully creates the file but results in:
touch: setting times of 'test.txt': Operation not supported
'mv test.txt asdf.txt' fails:
mv: cannot move 'test.txt' to 'asdf.txt': Operation not supported
syslog output:

Jul 22 06:25:40 [SERVER] s3fs[16379]: [path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=0]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt/]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt/][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt/] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt/][bpath=][save=][sseckeypos=0]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt/] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:40 [SERVER] s3fs[16379]:   [path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]?delimiter=/&max-keys=2&prefix=test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com?delimiter=/&max-keys=2&prefix=test.txt/
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [GET] [/] [delimiter=/&max-keys=2&prefix=test.txt/] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:40 [SERVER] s3fs[16379]:       add no object cache entry[path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]: [path=/test.txt][mode=100644][flags=0x8841]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       add stat cache entry[path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       delete stat cache entry[path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]: [path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]: [path=/test.txt][pseudo_fd=2]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=][path=/test.txt][pseudo_fd=2][physical_fd=8]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=][path=/test.txt][pseudo_fd=2][physical_fd=8]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       uploading... [path=/test.txt][fd=8][size=0]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [PUT] [/test.txt] [] [e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:40 [SERVER] s3fs[16379]:       delete stat cache entry[path=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]: [path=/test.txt][mtime=0.1073741823][ctime/atime=0.1073741823]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:40 [SERVER] s3fs[16379]: curl.cpp:RequestPerform(2558): HEAD HTTP response code 400, returning EPERM.
Jul 22 06:25:40 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=0]
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:40 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:40 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:41 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:41 [SERVER] s3fs[16379]:       add stat cache entry[path=/test.txt]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       [path=/test.txt][physical_fd=8][mtime=1690039541.007890477][ctime=1690039541.007890477]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       [path=/test.txt][physical_fd=8][time=1690039541.007890477]
Jul 22 06:25:41 [SERVER] s3fs[16379]: meta is not pending, but need to keep current mtime.
Jul 22 06:25:41 [SERVER] s3fs[16379]:     [path=/test.txt]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:41 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:41 [SERVER] s3fs[16379]:       copying... [path=/test.txt]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       computing signature [PUT] [/test.txt] [] []
Jul 22 06:25:41 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:41 [SERVER] s3fs[16379]:       HTTP response code 501 was returned, returning ENOTSUP
Jul 22 06:25:41 [SERVER] s3fs[16379]: [path=/test.txt][pseudo_fd=2]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       [tpath=][path=/test.txt][pseudo_fd=2][physical_fd=8]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       delete stat cache entry[path=/test.txt]
Jul 22 06:25:41 [SERVER] s3fs[16379]: [path=/test.txt][pseudo_fd=2]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       [path=/test.txt][pseudo_fd=2]
Jul 22 06:25:41 [SERVER] s3fs[16379]:       delete stat cache entry[path=/test.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]: [path=/test.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/test.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]: curl.cpp:RequestPerform(2558): HEAD HTTP response code 400, returning EPERM.
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/test.txt][bpath=][save=][sseckeypos=0]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/test.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/test.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/test.txt] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:44 [SERVER] s3fs[16379]:       add stat cache entry[path=/test.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]: [path=/asdf.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/asdf.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/asdf.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/asdf.txt] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt][bpath=][save=][sseckeypos=0]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/asdf.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/asdf.txt
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/asdf.txt] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt/]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt/][bpath=][save=][sseckeypos=18446744073709551615]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/asdf.txt/] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt/][bpath=][save=][sseckeypos=0]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [HEAD] [/asdf.txt/] [] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:44 [SERVER] s3fs[16379]:       HTTP response code 404 was returned, returning ENOENT
Jul 22 06:25:44 [SERVER] s3fs[16379]:   [path=/asdf.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       [tpath=/asdf.txt]
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]?delimiter=/&max-keys=2&prefix=asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com?delimiter=/&max-keys=2&prefix=asdf.txt/
Jul 22 06:25:44 [SERVER] s3fs[16379]:       computing signature [GET] [/] [delimiter=/&max-keys=2&prefix=asdf.txt/] []
Jul 22 06:25:44 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:45 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:45 [SERVER] s3fs[16379]:       add no object cache entry[path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]: [path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]: [path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]: [from=/test.txt][to=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:   [path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:       [tpath=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]?delimiter=/&max-keys=2&prefix=asdf.txt/
Jul 22 06:25:45 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com?delimiter=/&max-keys=2&prefix=asdf.txt/
Jul 22 06:25:45 [SERVER] s3fs[16379]:       computing signature [GET] [/] [delimiter=/&max-keys=2&prefix=asdf.txt/] []
Jul 22 06:25:45 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:45 [SERVER] s3fs[16379]:       HTTP response code 200
Jul 22 06:25:45 [SERVER] s3fs[16379]:   [from=/test.txt][to=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:     [path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:       [tpath=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:       URL is https://us-southeast-1.linodeobjects.com/[SERVER]/asdf.txt
Jul 22 06:25:45 [SERVER] s3fs[16379]:       URL changed is https://[SERVER].us-southeast-1.linodeobjects.com/asdf.txt
Jul 22 06:25:45 [SERVER] s3fs[16379]:       copying... [path=/asdf.txt]
Jul 22 06:25:45 [SERVER] s3fs[16379]:       computing signature [PUT] [/asdf.txt] [] []
Jul 22 06:25:45 [SERVER] s3fs[16379]:       url is https://us-southeast-1.linodeobjects.com
Jul 22 06:25:45 [SERVER] s3fs[16379]:       HTTP response code 501 was returned, returning ENOTSUP
Jul 22 06:25:45 [SERVER] s3fs[16379]: [path=/asdf.txt]

@ggtakec
Copy link
Member

ggtakec commented Jul 23, 2023

@icassassin @gaul
Could you please elaborate on the steps to reproduce this issue and the s3fs startup options?
(I have not been able to reproduce issue #2218, because I may be misunderstanding something.)
I understand the code in question and how to fix it, but I need to reproduce the original bug to confirm.

@icassassin
Copy link

Some more details:
I have a S3 bucket hosted with Linode (now Akamai) that I mount via fstab:

[SERVER]-staging /mnt/[SERVER]-staging fuse.s3fs _netdev,allow_other,umask=0002,uid=1000,gid=1000,url=https://us-southeast-1.linodeobjects.com,passwd_file=/root/passwd-linode-s3fs,use_sse=custom:/root/.[SERVER]-s3fs_key,bucket_size=100GiB,dbglevel=info 0 0

Detailed steps to reproduce:

cd /mnt/[SERVER]-staging/
touch test.txt

This results in the file being created but also:
touch: setting times of 'test.txt': Operation not supported

It should be noted that the file date/time seen from running

ls -al

Shows what appears to be the correct time (for the server settings).

total 4K
drwxrwxr-x 1 [USER] [USER]    0 Dec 31  1969 .
drwxr-xr-x 9 root     root     4096 Jul 22 18:30 ..
-rwxrwxr-x 1 [USER] [USER]    0 Jul 22 18:35 test.txt

Then I try to move the file:

mv test.txt asdf

This results in the file not being moved (test.txt remains, asdf.txt is not created) and I receive:
mv: cannot move 'test.txt' to 'asdf.txt': Operation not supported

Changing options for s3fs to use_sse=1 instead:

[SERVER]-staging /mnt/[SERVER]-staging fuse.s3fs _netdev,allow_other,umask=0002,uid=1000,gid=1000,url=https://us-southeast-1.linodeobjects.com,passwd_file=/root/passwd-linode-s3fs,use_sse=1,bucket_size=100GiB,dbglevel=info 0 0

Then:

touch test.txt

Results in in messages returned and the file test.txt existing

mv test.txt asdf.txt

Results in test.txt no longer existing and asdf.txt existing.

@ggtakec
Copy link
Member

ggtakec commented Jul 23, 2023

@icassassin Thanks for the details.

But strangely enough, I could not reproduce it.
(The steps were the same as given in #2218, I re-ran them/this and they worked fine.)
What differs from your environment is that I tested with AWS S3.
(Is this problem dependent on Linode Object Storage?)

In any case, this @gaul's modified code is also working fine and this PR is fine.
Then, this PR will be merged soon.

Thank you for your cooperation.

@ggtakec ggtakec merged commit 2405706 into s3fs-fuse:master Jul 23, 2023
17 checks passed
@ggtakec
Copy link
Member

ggtakec commented Jul 23, 2023

@gaul I wasn't able to reproduce the problem, but the fixed code is fine, so I merged this PR.
If you still have any problems, please let me know.

@icassassin
Copy link

@icassassin Thanks for the details.

But strangely enough, I could not reproduce it. (The steps were the same as given in #2218, I re-ran them/this and they worked fine.) What differs from your environment is that I tested with AWS S3. (Is this problem dependent on Linode Object Storage?)

In any case, this @gaul's modified code is also working fine and this PR is fine. Then, this PR will be merged soon.

Thank you for your cooperation.

Yeah I'm starting to think this is Linode specific, but I'm not sure where to start looking for 'why'. There isn't any indication that sse-c is treated any differently than anything else. I don't think there is anything I have custom in my setup that would get in the way. I'll keep futzing around with the setup to see if I can get any more clues.

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants