Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

signatureVersion v3 AccessDenied, v4 works but only directly with aws-sdk #69

Open
fform opened this issue Dec 18, 2014 · 39 comments
Open

Comments

@fform
Copy link

fform commented Dec 18, 2014

I'm trying to use s3client.uploadFile.

If I set signatureVersion to "v3", the only way I can upload without getting AccessDenied is to make the bucket read/write from everyone. Obviously I don't want to do that.

If I set the signatureVersion to "v4", I get [Error: Non-file stream objects are not supported with SigV4 in AWS.S3]

I just built a side example using aws-sdk:2.1.4. I initialize the client with the same parameters and then

var params = {
    Bucket: "myBucket",
    Key: "testing.txt",
    Body: 'Hello!'
};

awsS3Client.putObject(params, function (err, data) {
    if (err)
        console.log(err);
    else console.log("Successfully uploaded data to ", params.Bucket, params.Key);
});

This works fine using the same bucket and IAM credentials.

So I have a feeling that however my bucket policy is setup (or maybe you can't define a v3 policy anymore), it won't let me use v3. But then it seems node-s3 doesn't work with v4.

Can anyone confirm this? I am passing a filename and not a stream, but it looks like internally it's chunking the file or something?

@jaanus
Copy link

jaanus commented Dec 20, 2014

I just hit the same error. Trying to get a basic upload going but hit the same problem. With v3, it is denying access saying that I need to use v4. With v4, I get the same Non-file stream objects error.

@AoDev
Copy link

AoDev commented Feb 12, 2015

I have the same issue trying to upload / sync dir with Frankfurt. First I got an error saying that only SigV4 is supported in Frankfurt. Then, got Non-file stream objects error

@cristiboariu
Copy link

Any plan to fix this issue?

@fform
Copy link
Author

fform commented Mar 3, 2015

This is not a solution, but for anyone coming across this, my solution was to instead use the knox s3 library https://github.com/LearnBoost/knox

@deyhle
Copy link

deyhle commented Mar 9, 2015

This makes the module unusable in the newer v4-only regions. Would be great if the issue could be fixed.

@benedikt
Copy link

I'd love to see a fix for this issue as well. Is there anything I can do to help with this?

@deliverymanager
Copy link

I have the same problem with eu-central-1 region only supporting the new authorization mechanism.

@talkhot
Copy link

talkhot commented May 25, 2015

Would be great if this issue would be fixed.

@MikeAski
Copy link

+1. Really annoying.

@Fed03
Copy link

Fed03 commented Jun 10, 2015

+1

1 similar comment
@krstffr
Copy link

krstffr commented Sep 16, 2015

+1

@doron2402
Copy link

+1 is it still and issue ?

@newenegue
Copy link

+1

@faceleg
Copy link
Contributor

faceleg commented Dec 8, 2015

This issue is waiting for a PR from one of the glorious community members

@siliconsenthil
Copy link

Really?

@faceleg
Copy link
Contributor

faceleg commented Dec 8, 2015

I'm not sure why that's surprising

@kaore
Copy link

kaore commented Dec 16, 2015

followed @fform solution and switched to knox

@slavafomin
Copy link

+1

1 similar comment
@zissot
Copy link

zissot commented Mar 2, 2016

+1

@jschlieber
Copy link

I hope this can be fixed soon...

@Tsenzuk
Copy link

Tsenzuk commented Mar 18, 2016

probably the same issue is #128

@Paveltarno
Copy link

+1

2 similar comments
@andreasbkrueger
Copy link

+1

@Gottwik
Copy link

Gottwik commented May 24, 2016

+1

@Elijen
Copy link

Elijen commented Jun 5, 2016

Is there any workaround for this issue? Or has anybody investigated what's causing the error?

@rammrain
Copy link

+1

3 similar comments
@delijah
Copy link

delijah commented Jun 21, 2016

+1

@xileffelix
Copy link

+1

@sivavisakan
Copy link

+1

@blackvirus18
Copy link

+1 has there been any fix for this?

@KalanaPerera
Copy link
Contributor

when you guys trying to fix this issue :( , its a new version issue

@ifl0w
Copy link

ifl0w commented Jul 26, 2016

The aws-sdk dependency of this package seems to be out of date and to cause this problem.
An easy workaround that worked for me is to create a client from an existing aws object of the newest aws-sdk version.

This function is also described in the documentation:
https://github.com/andrewrk/node-s3-client#create-a-client-from-existing-awss3-object

I also included a little code snippet for better understanding:

var s3 = require('s3'); // https://github.com/andrewrk/node-s3-client
var AWS = require('aws-sdk'); // https://www.npmjs.com/package/aws-sdk

// use newest sdk to avoid: https://github.com/andrewrk/node-s3-client/issues/69
var awsS3Client = new AWS.S3();

var client = s3.createClient({
  s3Client: awsS3Client
});

So I think updating the dependencies of this package would remove the problem.

@KalanaPerera
Copy link
Contributor

Hi ,

This issue , I have fixed and send pull request, please check and merge it with master ,

@saksham
Copy link

saksham commented Oct 13, 2016

+1

1 similar comment
@vishak-mokko
Copy link

+1

@faceleg
Copy link
Contributor

faceleg commented Jan 4, 2017

I don't have permission to push npm updates, so I've forked this to: https://github.com/faceleg/node-s3-client.

npm i @faceleg/s3

@hacktvist
Copy link

+1

@junedev
Copy link

junedev commented Jan 16, 2017

The workaround @ifl0w proposed worked fine for me.

@willowiscool
Copy link

+1. I still have this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests