Implement HeadBucket
#618
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#618
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Would it be possible to implement the
HeadBucket
API? This is useful for determining whether a bucket exists or not and whether the authenticated user has access to it. It can also be used by software to determine whether the bucket should be created or not.Thanks,
Gusted
HeadBucket is supposed to be implemented, what issues are you having with it ?
An user of Forgejo (using Garage as S3 storage) reported that
400 Bad Request
was returned on a function call fromBucketExists
aftera321a4c2fc
. From what I gather from the documentation it meant that the function isn't implemented, but I don't have much experience with S3 so it was premature on my part to say it wasn't implemented. If you say it's implemented I will go back and see what else it could've caused this.Here is a reproducer for this issue. It may simply be a misconfiguration but it not trivial to figure out for me because I do not have any experience (yet) with garage.
mc ls --recursive testgarage/
tail /tmp/forgejo-upgrades/garage*.log
The same error shows when trying to connect from Forgejo.
The error seems to indicate a problem with the signature of the request, not with the HeadBucket endpoint per se. Can you ensure that your S3 client is configured to use the correct region? This is often a cause of this kind of issues.
Also, if you have time, please post the logs with
RUST_LOG=garage_api=debug
I would like to let garage know that
20230828/us-east-1/s3/aws4_request
is a valid scope. A pointer on how to do that would be much appreciated.If you have set
s3_region = "us-east-1"
in your config file then it is a valid scope, otherwise it is not (but there is a redirection mechanism in the error message that clients can use to select the correct region instead, maybe that's just not implemented).I think some applications do a
HeadBucket
withus-east-1
(the original AWS region) so they can learn the real region from thex-amz-bucket-region:
header in the response, and not require it as a configuration variable. RIght now, Garage has no support for that I thinkThe logs with debug:
I'll try to switch to MD5
But MD5 is only relevant when content is PUT/GET, my bad.
That fixed the problem.
Now the real fix is client side, not garage side. I'll check the content of the error message and look for the redirection. Is there documentation somewhere about that?
I think this issue can be closed now, thanks a lot for your help. And I'm personally very happy that garage is using Fogejo.
I can't seem to find any official documentation for this, but it is attested that S3 sometimes returns a
<Region>
tag in the XML body of all its error responses, includingAuthorizationHeaderMalformed
. This region corresponds to the region of the server. There is an example here with an official response from AWS S3. Garage returns this tag in all of its error responses with value equal to the region that is set in the config file.