2
votes

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

2
Please contact Firebase support if you have deployment errors without helpful error messages. firebase.google.com/support/contact/troubleshooting - Doug Stevenson
I had to disable Kaspersky anti-virus while deploying the Cloud Functions. - Fabio M. Segre

2 Answers

3
votes

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
0
votes

Adding the --debug flag to your deploy command can provide some additional details

firebase deploy --debug --only functions

It looks like there have been some intermittent service disruptions with cloud functions over the past week, and I wouldn't be surprised if that is what you are experiencing currently, though the Firebase team isn't reporting any outages currently.

My attempted deploy just now failed with the following error:

[2018-03-08T16:55:56.923Z] Error: Firebase.authWithCustomToken failed: First argument must be a valid credential (a string).

However, when I confirm I'm authenticated via "firebase login" I receive:

Already logged in as [email protected]

I've had this happen on and off over the past few days and it doesn't seem to be related to anything specific in my code or setup.

UPDATE: My deploys just started working again