Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeoutError: Connection timed out after 10000ms #121

Open
meghjoshi opened this issue Oct 27, 2016 · 5 comments
Open

TimeoutError: Connection timed out after 10000ms #121

meghjoshi opened this issue Oct 27, 2016 · 5 comments
Labels

Comments

@meghjoshi
Copy link

TimeoutError: Connection timed out after 10000ms

The image is uploaded on s3 with all their sub variations but after uploading i am getting error for Connection timeout

Your environment

  • Operating system
    • Linux
  • Node.js version (node --version)
    • Node.js v6.x
  • ImageMagick version (identify -version)
    • ImageMagick v7.0.x
  • s3-uploader version
    • v2.x

Steps to reproduce

below is my code

var client = new s3Upload(awsbucket, {
    aws: {
        path: 'images/',
        region: 'us-west-2',
        acl: awsACL,
        accessKeyId: awsKeyId,
        secretAccessKey: awsKey,
    },

    cleanup: {
        versions: true,
        original: false
    },

    original: {
        awsImageAcl: 'public-read'
    },

    versions: [{
        maxHeight: 1040,
        maxWidth: 1040,
        format: 'jpg',
        quality: 80,
        suffix: '-large',
        folderPath: 'large/'
    }, {
        maxWidth: 780,
        aspect: '3:2!h',
        suffix: '-medium',
        folderPath: 'medium/'
    }, {
        maxWidth: 320,
        aspect: '16:9!h',
        suffix: '-small',
        folderPath: 'small/'
    }, {
        maxHeight: 250,
        maxWidth: 250,
        aspect: '1:1',
        suffix: '-thumb',
        folderPath: 'thumb/'
    }]
});
var fileCounter = 0;
var filepath = req.file.path;
var filename = req.file.filename;
client.upload(filepath, {}, function (err, versions, meta) {
    if (err) {
        throw err;
    }

    versions.forEach(function (image) {
        fileCounter++;
        console.log(image);
        console.log('versions.length',versions.length);
        console.log('fileCounter',fileCounter);
        //console.log(image.width, image.height, image.url);
        if (fs.existsSync(filepath)) {
            fs.unlinkSync(filepath);
        }
        if (versions.length === fileCounter) {
            var im =image.key.split('/');
            return res.json({success: true, filename: im[im.length - 1]});
        }
        // 1024 760 https://my-bucket.s3.amazonaws.com/path/110ec58a-a0f2-4ac4-8393-c866d813b8d1.jpg
    });
});
and getting error like belwo image
http://i.prntscr.com/62fad87356564e7f9bd3eb3bac93294a.png
@javiercf
Copy link

any update on this?

@alfiepoleon
Copy link

From this aws sdk documentation Try this

  aws: {
    path: '...',
    region: '...',
    acl: '...',
    httpOptions: { timeout: 120000 }, // Play with values here (milliseconds)
    accessKeyId: '...',
    secretAccessKey: '...',
  }

@iggyZiggy
Copy link

tried the last solution, error just changed to:

RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.

@iggyZiggy
Copy link

for anyone else who gets stuck on this one, double check your aws.region if it's the right one

@abhishekp1996
Copy link

By default the region is us-east-1. If you have server in some other location, add the region property in aws key in client object. I solved it this way. Hope this helps. :)

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

No branches or pull requests

6 participants