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

uploadDir: Non-file stream objects are not supported with SigV4 in AWS.S3 #196

Open
Troy-Yang opened this issue Jan 20, 2018 · 1 comment

Comments

@Troy-Yang
Copy link

Troy-Yang commented Jan 20, 2018

Hi guys,

Have you encountered an exception below when using uploadDir API method?

s3-test.js:36
progress 2857456 4219649
s3-test.js:36
progress 2817113 4219649
s3-test.js:36
unable to sync: Error: Non-file stream objects are not supported with SigV4 in AWS.S3
s3-test.js:33
    at Request.computeSha256 (e:\test\node\node_modules\aws-sdk\lib\services\s3.js:200:18)
    at Request.callListeners (e:\test\node\node_modules\aws-sdk\lib\sequential_executor.js:97:18)
    at Request.emit (e:\test\node\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
    at Request.emit (e:\test\node\node_modules\aws-sdk\lib\request.js:604:14)
    at Request.transition (e:\test\node\node_modules\aws-sdk\lib\request.js:21:12)
    at AcceptorStateMachine.runTo (e:\test\node\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at e:\test\node\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (e:\test\node\node_modules\aws-sdk\lib\request.js:22:9)
    at Request.<anonymous> (e:\test\node\node_modules\aws-sdk\lib\request.js:606:12)
    at Request.callListeners (e:\test\node\node_modules\aws-sdk\lib\sequential_executor.js:104:18)

My s3 version is latest "s3": "^4.4.0", aws sdk:"aws-sdk": "~2.0.31"

I then tried to change default Sigv4 to Sigv3 and v2. Sigv3 shoule me acess deined issue, Sigv2 shows me an 'unable to sync: TypeError: Cannot set property 'Timestamp' of undefined'.

Here is my s3 options:

...
 s3Options: {
   accessKeyId: "xxx",
   secretAccessKey: "xxx",
   region: "ap-northeast-1",
   // signatureVersion: 'v3'
 }

One thing needs to mention is 'downloadFile' and ‘uploadFile’ API method work good.

Thanks,
Troy

@sators
Copy link

sators commented Feb 1, 2018

See the fix found here: #175 (comment)

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

No branches or pull requests

2 participants