Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Function deployment error

I'm working with Firebase cloud functions and facing errors while deploying the functions. There are different errors every time. Right now, it's "Server Error: Unexpected Response. Please try again". Whereas, Sometimes it's "Server Error. socket hang up"

I checked firebase-debug.log file, which states that service is not available, whereas, as per Status Dashboard, it's working fine

Another Issue with Naming Convention:

Apart from this, i'm facing issues in deployment when i change the function name from helloWorld to something else. It's quite strange as i've total three functions. Two of them are working fine, whereas, when i change the name of helloWorld to something like generateWeeklyReport, newThreadsReport, weeklyReport it fails every time.

I'm using Spark plan of Firebase and right now the names of functions in my index.js file are: helloWorld, quickChatUserReport, activeThreadsReport. Is there any naming convention, or is there any limitation on the number of functions in this plan? I couldn't find anything in the documentation. Please guide.

Side Note: I read that Kaspersky Endpoint security blocks callbacks resulting in deployment failure. I turned off the protection while deploying function + I'm using node version 9.5.0

like image 216
Fayza Nawaz Avatar asked Sep 05 '26 02:09

Fayza Nawaz


1 Answers

The issue in my case was that I updated node version after installing firebase tools. This is the thing which caused the problem and I was not even able to run the functions on my localhost.

I had to uninstall firebase tools completely from my machine, remove the node_modules folder from my project and then reinstall both. It worked.

Commands I used are:

npm uninstall -g firebase-tools
npm install -g firebase-tools

Then I tested my functions as:

firebase deploy --only functions --debug  //deployment on cloud
firebase serve --only functions --debug   //testing on localhost
like image 186
Fayza Nawaz Avatar answered Sep 07 '26 18:09

Fayza Nawaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!