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

timeout error while uploading after 100% #222

Open
manoj-compro opened this issue Jun 19, 2019 · 1 comment
Open

timeout error while uploading after 100% #222

manoj-compro opened this issue Jun 19, 2019 · 1 comment

Comments

@manoj-compro
Copy link

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
Copy link

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

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