Closed dat-huynhtuan-tpv-clv closed 2 months ago
node: 8
Hello @dat-huynhtuan-tpv-clv. Sorry if I misunderstood, but are you running Node version 8? Also, you may update your version of firebase-functions as well. That may fix your issue
node: 8
Hello @dat-huynhtuan-tpv-clv. Sorry if I misunderstood, but are you running Node version 8? Also, you may update your version of firebase-functions as well. That may fix your issue
Hi @exaby73. Sorry it was my typo, node 8 is incorrect it should be node 18.16.1, let me edit the post and I will try to update firebase functions if the error happens again since it is hard to know why the error is popped up.
Hey @dat-huynhtuan-tpv-clv. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hi @exaby73, updated for you on this post. I think I know what is wrong to my cloud functions, it seems like my cloud function isn't idempotent and the google cloud storage sometimes trigger the same function again on the same object so firebase is handling the same response twice and it could make the error to pop up. After making the cloud function idempotent I also move the admin.initializeApp(); inside the cloud function because based on what I've observed the cloud functions can be triggered multiple times at the same object so I think it is not the best option to leave it as globally.
You can also use the new onInit
function to run code on each startup. It's a good place to have initializeApp
. Since you were able to solve your issue, I will close this issue. Thank you
[REQUIRED] Version info
node: 18.16.1
firebase-functions: 4.6.0
firebase-tools: 13.11.2
firebase-admin: 11.11.1
[REQUIRED] Test case
I have checked my codes and logs within the Log Explorer of the current cloud function but before or after the error, the error is no where to be seen again. I also test this code at non-prod environment but also found no clue. This is my error message
[REQUIRED] Steps to reproduce
See my test case section
[REQUIRED] Expected behavior
The function should show success insert like all the logs before or after the error.
[REQUIRED] Actual behavior
Only one error is thrown out, I did check in my firesbase datastore, all the data before and after the error were successfully inserted only one record was not inserted
Were you able to successfully deploy your functions?
Yes. The function was deployed 2 weeks ago and it was doing fine until now