Janaka Chathuranga
Janaka Chathuranga

Reputation: 1840

Firebase Functions stopped Working and Can't deploy again

Firebase Cloud functions giving an error called.

Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.

When I try to re-deploy, it gives following error.

Error setting up the execution environment for your function. Please try again after a few minutes.

What could be the reason? Is it following issue? Sates: https://status.firebase.google.com/incident/Functions/18018

Upvotes: 5

Views: 4997

Answers (3)

Victor Oliveira
Victor Oliveira

Reputation: 3713

I tried several different steps, including updating tools from firebase, using different node versions or dependencies on package.json. In the end, at firebase functions console, I cleared the log stack and tried to reach every deployment notification after executing firebase deploy. I found out one of my dependencies were moved from dependencies to devDependencies, which was causing

ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Error setting up the execution environment for your function. Please try again after a few minutes.

enter image description here

Solution:

  1. Place back dependency on its place, moving from devDependencies into dependencies itself.

  2. Update project dependencies with npm install

  3. Re-deploy with firebase deploy

Upvotes: 1

sumit
sumit

Reputation: 15464

I had the same issue and it was fixed after updating firebase-tools. I saw following on my console

         Update available 7.0.0 → 7.8.1       
         Run npm i -g firebase-tools to update   

Then i just changed node version and updated firebase tools

nvm use 11
npm upgrade firebase-tools -g

Sometimes switching environment will also help

firebase use dev

Sometimes when some node modules are not installed , the error you get will be like below

Deployment error.
Error setting up the execution environment for your function. Please try deploying again after a few minutes.

Make sure that all node modules are installed prior to deployment, I wasted almost 2 days and realised one node module was not installed .

Upvotes: 2

Peter Haddad
Peter Haddad

Reputation: 80914

Yes there is an issue with Cloud Functions, as you can see from the link above

Investigating an issue with Functions

Incident began at 2018-03-09 03:30 (all times are US/Pacific).

Last update is this:

Mar 09, 2018 04:45
We are still investigating the issue with Cloud Functions execution. We will provide another status update as soon as possible.

https://status.firebase.google.com/incident/Functions/18018

After the issue is done, you will be able to deploy your functions again using the below:

firebase deploy --only functions

Edit:

I just deployed some functions and it is working now, just takes a bit of time.

Upvotes: 9

Related Questions