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) .Past similar discussions I found: https://clojurians.slack.com/archives/C09N0H1RB/p1581629013099800
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
@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?
It works fine with the aws cli. Truth be told: with the cli I query for the whole uri and that works fine