andrewrk / node-s3-client

high level amazon s3 client for node.js
MIT License
1k stars 303 forks source link

timeout error while uploading after 100% #222

Open manoj-compro opened 5 years ago

manoj-compro commented 5 years ago

I was also facing the same issue (Error: Non-file stream objects are not supported with SigV4 in AWS.S3) but after updating as per your suggestion I m getting an timeout error somehow. After 100% its end event does not get fired. Thanks in advance. As I m new to this so may be I am missing something here.

Here is the details : "aws-sdk": "^2.478.0", "s3": "^4.4.0",

const awsS3Client = new AWS.S3({ accessKeyId: argv.accessKeyId, secretAccessKey: argv.secretAccessKey, region: 'us-east-2', signatureVersion: 'v4' });

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

let uploaderObj;

uploaderObj = client.uploadDir(params);

let prevProgress = 0; uploaderObj.on('progress', function () { if (prevProgress !== uploaderObj.progressAmount) { console.log(Progress: ${Math.round(uploaderObj.progressAmount / uploaderObj.progressTotal * 100)}%); prevProgress = uploaderObj.progressAmount; } });

uploaderObj.on('error', (error) => { reject(error); });

uploaderObj.on('end', () => { if (prevProgress === 0) console.log('Nothing to upload. Already up to date.'); resolve('Done uploading.'); })

BlackHole1 commented 5 years ago

This library is no longer maintained, this is a bug, you can use @auth0/s3 to solve the problem. @auth0/s3 is a fixed version of s3