question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ECONNRESET error while getting an image URL

See original GitHub issue

When I tried to upload a camera image to AWS bucket the following error will get :

camera upload error {“errno”:“ECONNRESET”,“code”:“ECONNRESET”,“syscall”:“read”} { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: ‘ECONNRESET’, code: ‘ECONNRESET’, syscall: ‘read’ }

Actually, the image will able to upload from Heroku and my local machine. When I tried from the production env, will get the above error. The following are the piece of code which I have used for uploading an image to AWS bucket :

 var request = require("request");
 var moment = require('moment-timezone'),
 var AWS = require('aws-sdk');
 AWS.config.update({
 accessKeyId: accessKeyId,
 secretAccessKey: secretAccessKey
 });
 var requestretry = require('requestretry');
 var s3 = new AWS.S3(),
 s3Stream = require('s3-upload-stream')(new AWS.S3());

 var date = moment().unix();
 var options = {
 method: 'GET',
 url: image_url
 };
 var d = Date.now();
 var upload = s3Stream.upload({
 Bucket: 'twilio-voice-clip/voice',
 Key: 'cameraimage' + d + '.jpeg',
 ACL: 'public-read',
 ContentType: 'image/jpeg'
 });


 request(options)
 .on('response', function (response) {
    if (response.statusCode != 200) {
        console.log(respDetails);
    }
   })
 .on('error', function (err) {
    console.log('camera upload error', JSON.stringify(err));

  })
 .pipe(upload)
 .on('uploaded', function (details) {
    console.log(details.Location);
 });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
joseamtcommented, Oct 11, 2018

@ejoebstl Yes, It is able to download via curl command.

0reactions
reconbotcommented, Nov 22, 2018

Yeah this is a network level thing. Probably just in your production environment. Without more info it’s impossible to debug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ECONNRESET error while getting an image URL
When I tried to upload a camera image to AWS bucket the following error will get : camera upload error {"errno":"ECONNRESET" ...
Read more >
What does “Error: read ECONNRESET” mean? - Quora
It means that your application dropped it's TCP connection. For example, if you lost your wifi signal while running your app you would...
Read more >
ECONNRESET on the API URL every few minutes - openBalena
After some time my balena CLI stops to work and I get the following error when I try to log again: Logging in...
Read more >
Error: 'read ECONNRESET' unable to retrieve components in ...
Then make sure Proxy Strict SSL is unchecked. (You will find it right below the above Proxy input field). Then make sure the...
Read more >
NodeJS - What does socket hang up actually mean - Edureka
When you're a customer, When you send a request to a distant server as a client and don't get a response in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found