ECONNRESET error while getting an image URL
See original GitHub issueWhen 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:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ejoebstl Yes, It is able to download via curl command.
Yeah this is a network level thing. Probably just in your production environment. Without more info it’s impossible to debug.