Node 8 functions ending with "finished with status: 'connection error'"
See original GitHub issueFirebase function triggered by firestore trigger is ending prematurely with finished with status: 'connection error'
. There are no errors logged from actual function. Phase where function is exiting is varying. Most of the functions (lighter functions, with less communication to firestore) are finishing ok.
When runtime is changed to “Node.js 10 Beta” functions are working correctly.
Region: europe-west1 Memory allocated: 1 GB Timeout: 300 seconds
Related issues
#429 (already closed)
[REQUIRED] Version info
node: node 8 (in cloud) v12.4.0 (locally)
firebase-functions: “firebase-functions”: “3.3.0”
firebase-tools: “firebase-tools”: “7.12.1”
7.12.1
firebase-admin: “firebase-admin”: “8.9.1”
[REQUIRED] Test case
have not been able to extract code to reproduce it outside of my codebase. I have case where this is happening 100% of executions.
[REQUIRED] Steps to reproduce
Run function which is querying multiple documents from firestore using firebase-admin.
repo for reproducing issue: https://github.com/diginikkari/case00032967
Reproduction steps:
- create firestore project
- Initialize firestore database for project
- get service account credentials and save it root folder with name: service-account.json
- build and deploy functions
npm run build; npm run deploy
- generate fake test data
npm run generate-fake-data
- call function which add order document to firestore, which then triggers the firestore function trigger
npm run create-order-copy
- check logs
npm run logs
When function is using “node 8” it will end with finished with status: 'connection error'
.
When changing to “node 10” function is ending finished with status: 'ok'
[REQUIRED] Expected behavior
Function is finished succesfully.
[REQUIRED] Actual behavior
Function is ending prematurely with finished with status: 'connection error'
message.
Were you able to successfully deploy your functions?
Yes, there were no errors with deployment.
log from errored execution.txt

Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:24
We’re also experiencing this issue on a scheduled function that runs every minute. We first experienced the “connection error” result at 5:51pm PST on Jan 18th. As with the others in this thread, using the Node 10 Beta runtime fixes the issue, but that obviously is not an ideal solution.
@steven-tib I changed function runtime to node.js 10. This was desperate try because nothing else helped and for some reason it worked at least for me. So perhaps that is something you could try also.
I’m bit worried on using node.js 10 because it’s still in beta. But I figured that what I have to lose. I keep my functions in node 10 at least until this issue is solved.