Error: read ECONNRESET when resizing image in Storage
See original GitHub issueI’d like to resize an image stored in Firebase Storage with Firebase Functions.
Based on this example : https://github.com/firebase/functions-samples/blob/master/quickstarts/thumbnails/functions/index.js I try to write a function triggered by a Database event.
Here is the most interesting part of the code :
const gcs = require('@google-cloud/storage')();
...
const bucket = gcs.bucket('...appspot.com');
const originalFilepath = myObject.picture1Url;
const tempFilePath = '/tmp/myThumbnail';
console.log('1');
return bucket
.file(originalFilepath)
.download({
destination: tempFilePath
})
.then(() => {
console.log('2');
});
Everything looks fine to me. However the code never go to the console.log(‘2’); and I get this error :
Error: read ECONNRESET
at exports._errnoException (util.js:1026:11)
at TCP.onread (net.js:569:26)
Does somebody know what could be the error?
Thank you
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error: read ECONNRESET when resizing image with Firebase ...
I'd like to resize an image stored in Firebase Storage with Firebase Functions. Based on this example provided by the Firebase team :...
Read more >read ECONNRESET when working with large data in Firebase ...
Coding example for the question Error: read ECONNRESET when working with large data in Firebase Cloud functions-node.js.
Read more >Fixing an ECONNRESET error - Postman
The ECONRESET error means that the server unexpectedly closed the connection and the request to the server was not fulfilled. Connection-related ...
Read more >Supabase Storage v2: Image resizing and Smart CDN
Today we're introducing three new features for Supabase Storage: Image resizing, webhooks, and a Smart CDN. These features are designed to ...
Read more >azure-sql-database - Microsoft Q&A - Microsoft Learn
ConnectionError: Connection lost - read ECONNRESET (Node.JS Error) · azure-sql-database ... Read scale-out is giving the error "Execution Timeout Expired.".
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
Yes the issue is what @ahaverty described.
When you do this:
You are starting 3 asynchronous processes but you are returning right away. Therefore the instance gets shut down and your 3
createThumbnail
don;t have time to complete.Each of these returns a
Promise
. What you need to do is this instead:Thanks a lot. You have saved my day !