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

[Bug] - HTTP500 from GET list /bucket/file_not_dir/no_such_file #949

Closed
Ostheer opened this issue Nov 18, 2024 · 3 comments · Fixed by #955
Closed

[Bug] - HTTP500 from GET list /bucket/file_not_dir/no_such_file #949

Ostheer opened this issue Nov 18, 2024 · 3 comments · Fixed by #955
Labels
bug Something isn't working

Comments

@Ostheer
Copy link

Ostheer commented Nov 18, 2024

Describe the bug
Doing a HTTP/HEAD GET request to a path like whatever/this_is_an_existing_file_and_not_a_dir/this_file_cannot_be_here yields a 500 server error, throwing off some clients expecting a 404 (see context below).

In my versity log, I see
Internal Error, walk testbucket: stat empty-0/.zattrs/.zarray: not a directory

Note that I previously filed an issue, #942, for this. @benmcclelland quickly merged some changes that slightly but not qualitatively altered the server error message.
I created this second issue because I got no response yet on my comment on the old issue. Feel free to close this and continue work in the old issue.

To Reproduce

xr.DataArray().to_zarr("s3://testbucket/empty-0", storage_options={"key": ..., "secret": ..., "endpoint_url": "http://..../"})

Expected behavior
A 404 would seem sensible.

Server Version
Compiled from git master branch after commit 0312a1e as described in this comment

Version  : 1.0.8
Build    : a26f069
BuildTime: 2024-11-12_01:04:10PM
Linux sr-storage 6.8.4-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-2 (2024-04-10T17:36Z) x86_64 GNU/Linux
@Ostheer Ostheer added the bug Something isn't working label Nov 18, 2024
@benmcclelland
Copy link
Member

Sorry I missed the update to the other issue. I am able to reproduce this in the list-objects API. Let's keep this issue open for tracking this one since it is slightly different than the other issue (list vs head).

% aws s3api put-object --bucket test --key file                      
{
    "ETag": "d41d8cd98f00b204e9800998ecf8427e"
}
% aws s3api list-objects-v2 --bucket test --prefix file/file/file

An error occurred (InternalError) when calling the ListObjectsV2 operation (reached max retries: 2): We encountered an internal error, please try again.

@Ostheer
Copy link
Author

Ostheer commented Nov 19, 2024

You're right! The HEAD now does return 404. The 500 is caused by a GET with parameter "list-type...":

Nov 19 09:44:10 sr-storage versitygw-measurementsgw[529]: 2024/11/19 09:44:10 Internal Error, walk testbucket: stat test-wlshift-10/.zattrs/.zarray: not a directory
Nov 19 09:44:10 sr-storage versitygw-measurementsgw[529]: 09:44:09 | 500 |     433.296µs | 10.10.10.4 | GET | /testbucket | - | list-type=2&prefix=test-wlshift-10%2F.zattrs%2F.zarray%2F&delimiter=%2F&max-keys=1&encoding-type=url

@Ostheer Ostheer changed the title [Bug] - HTTP500 from HEAD /bucket/file_not_dir/no_such_file [Bug] - HTTP500 from GET list /bucket/file_not_dir/no_such_file Nov 19, 2024
@Ostheer
Copy link
Author

Ostheer commented Nov 20, 2024

Yes! It works now :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants