Fork me on GitHub
#aws
<
2024-03-11
>
Mario Trost07:03:59

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) .

Mario Trost07:03:08

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

scottbale14:03:04

@ULA8H51LP 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?

Mario Trost17:03:23

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