Giter Club home page Giter Club logo

Comments (7)

shuttie avatar shuttie commented on August 26, 2024 1

@marad Can you provide more concrete & full code example for this failure? As I cannot reproduce this issue.

from s3mock.

marad avatar marad commented on August 26, 2024 1

@shuttie Ok, I've found the cause of my problems. In my code I need to create connection with:

val clientConfig = new ClientConfiguration()
clientConfig.setSignerOverride("S3SignerType")
val client = new AmazonS3Client(credentials, clientConfig)

And this signer override is causing the files to be empty. Is there a way to support other signing algorithms in s3mock?

from s3mock.

marad avatar marad commented on August 26, 2024

Sure, I'll create small example code and send it here.

from s3mock.

marad avatar marad commented on August 26, 2024

@shuttie The problem is, really that the files are stored empty in the temporary directory when putting objects. Setting signer type is one way to achieve this. I'm suspecting other ways but will investigate later.

from s3mock.

sl33nyc avatar sl33nyc commented on August 26, 2024

@marad, I had a similar problem using S3Mock for Presigned URLs. I originally used AnonymousAWSCredentials in my tests but the code path for presigned URLs requires an access key. I found your earlier comment and switched to BasicAWSCredentials and overrode the signer per your comment and repro'd the same "zero bytes" problem.

It turns out that "S3SignerType" is incorrect. Both "AWS3SignerType" and "NoOpSignerType" work for me. I also can verify that the files are no longer zero bytes in size.

from s3mock.

C-Otto avatar C-Otto commented on August 26, 2024

We experience the same issue, caused by using S3SignerType. I suggest to change the name of this issue accordingly, and I'd appreciate a fix.

from s3mock.

C-Otto avatar C-Otto commented on August 26, 2024

The code expects the PUT payload after a chunk signature (example below). According to https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html this seems to be specific to V4. With V2 the client only sends the raw data, causing s3mock to fail because of the missing chunk signature.

V4:

org.apache.http.wire - http-outgoing-0 >> "3;chunk-signature=0d1d8b31c94d5e4effc1acb4a97632ae10355cf018fb454eb5400faa5be61bec[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "FOO[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "0;chunk-signature=4b2cc53ba80357f42d34d77d596cc47552d586bfa71fb506c0ecf94d9854723e[\r][\n]"

V2 is just org.apache.http.wire - http-outgoing-0 >> "FOO".

The failing logic is in S3ChunkedProtocolStage. In PutObject the S3ChunkedProtocolStage seems to be hardcoded in completeSigned.

from s3mock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.