aws

2024-03-11T07:44:59.382489Z

I have some objects in an S3 bucket with keys with a leading slash, e.g. /key/for/s3-object Using com.cognitect.aws/api with operation ListObject correctly returns that key, i.e. {… :Key /key/for/s3-object ...} . But when I try GetObject for this key, I get a not-found anomaly with

{... :Message The specified key does not exist., :Key key/for/s3-object ...}
It was trying to GetObject for a key key/for/s3-object without the leading slash. When I prepend one slash to the key, I get the requested object. Looks like GetObject always strips one leading slash. Is this known and expected behaviour? I can work around that by always prepending a leading slash: :Key (str "/" actual-key) .

2024-03-11T07:45:48.469649Z

Past similar discussions I found: https://clojurians.slack.com/archives/C09N0H1RB/p1581629013099800

2024-03-11T07:49:08.214329Z

That last discussion resulted in https://github.com/cognitect-labs/aws-api/issues/126 plus a fix in version 0.8.615 , but it doesn’t address the leading slash in keys for GetObject. I would expect to be able to use object keys returned by ListObject in GetObject . I would expect to be able to use

scottbale 2024-03-11T14:48:04.581509Z

@trost.mario have you tried this with aws cli? What is the behavior with list and get for a key such as /key/for/s3-object? Same problem, or works fine?

2024-03-11T17:09:23.843589Z

It works fine with the aws cli. Truth be told: with the cli I query for the whole uri and that works fine