Skip to content

S3 GetObject returns empty result body #912

@RLThomaz

Description

@RLThomaz

The C++ SDK is returning an empty result body for an object that the outcome result IsSucess and has GetContentLenght different than zero.

I followed most of AWS documentation and example codes - including the one officially available at Developer Guide. I also looked around for reported bugs and found this for the AWS JS SDK. Basically, there was something listening and intercepting the 'data' before the SDK could store it in the buffer.

I'm on Ubuntu 16.04, tried everything imaginable (firewall, netstat, killing applications), but still got an empty result body. I was not able to fix it - thus I'm submitting this issue - but I found a workaround. My workaround for this 'bug' uses the SetResponseStreamFactory to write a file as soon as the object is downloaded from the bucket.

objectRequest.SetResponseStreamFactory([filePath]()
{
 return new std::fstream(filePath.c_str(), std::ios::out | std::ios::binary);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe are asking the community to submit a PR to resolve this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions