51

irregularly my firebase deployment get stuck at this log:

i  functions: updating function [FUNCTION NAME]...

After canceling the deploy and retrying it throws the following error message:

⚠  functions: failed to update function resetBadgeCount
⚠  functions: HTTP Error: 400, An operation on function [FUNCTION NAME] 
in region us-central1 in project [PROJECT NAME] is already in progress. 
Please try again later.

So it seams like that the deploy got stuck and kept in the pipeline blocking further deploys. After a while it let me deploy the functions normally again. But is there an explanation for this? Or maybe even a word around?

Florian
  • 533
  • 1
  • 4
  • 5

10 Answers10

61

Go to Google cloud functions console and see if there is red exclamation mark against your function. Then select that particular function and try to delete. once it gets deleted from there, you can deploy again successfully. if it is showing spinner, then wait till it shows red mark.

Shahnaz Khan
  • 1,055
  • 1
  • 14
  • 26
  • 4
    It does neither show a red flag, nor a spinner. The dropdown-menu on a single function also does not give an option to delete that function. When I open details, edit and delete-buttons are deactivated, and it shows "Function is still being deployed". – Martin Bories Mar 15 '18 at 00:25
  • It won't let me delete the function. The only solution we found was to start a new project. – kevando Feb 18 '21 at 23:09
  • 1
    You are life savior. I tried so many things. Updating firebase cli, changing node version, look for log; couldn't find anything and nothing worked. Until I deleted functions. – The_ehT Oct 18 '21 at 18:46
  • 2
    I experienced this issue recently and it took approximately 45 minutes for the spinner to stop and the red exclamation mark to appear. As noted you cannot delete the function until the exclamation mark appears. You either have to be patient and wait, or if you need to continue work on your function, you can temporarily rename it as mentioned in a different response. I love Firebase but function deployment speed and occasional deployment issues are the worst part of their experience. – most200 Nov 14 '21 at 16:26
  • Seems like the added a new dependency to "devDependencies" instead of "dependencies" and that caused the problem. I uninstalled that dependency and installed it again (without --save or --save-dev, so it will be saved under "dependencies"). – Elron Dec 13 '21 at 02:47
14

Try this

You can fix the issue much easier by examining the actual logs using this command to open the log

firebase functions:log

The specific issue will be visible there. I sometimes even had errors as simple as a missing package in package.json

Abraham
  • 12,140
  • 4
  • 56
  • 92
5

You can temporarily rename your function:

$ firebase deploy --only functions

...

i functions: deleting function onSameDataChanged...

i functions: creating function onSameDataChanged1...

...

✔ functions: all functions deployed successfully!

✔ Deploy complete!

John Connor
  • 109
  • 2
4
  1. Comment or cut your function
  2. Deploy
  3. Uncomment or paste back the function
  4. Rename the function
  5. Deploy
  6. Rename the function back
  7. Deploy
Konstantin Konopko
  • 5,229
  • 4
  • 36
  • 62
1

also you can wait a few minutes and you will get an error with {"code":10,"message":"ABORTED"}, then you can deploy again.

PinkyXW
  • 31
  • 4
0

just copy your index.js to some where else and delete function form firebasa function console

  1. firebase init -and overe write all file again
  2. past index.js text again
  3. deploy...
jivan patel
  • 212
  • 2
  • 8
0

For me it was the node version. Turns out I had the 15.x on my machine and the 12.x on the server. Just updating it solved my upload issue

Leonardo Rick
  • 680
  • 1
  • 7
  • 14
0

Make sure you've installed dependencies in the functions directory.

for more information about you function you can go to this page

0

These are few possible scenarios that I've faced:

  1. Project is not git initiated
  2. functions/ directory doesn't have node_modules installed
  3. If you have already deployed your project, but redeploying is causing issues, you'll have to check your Firebase dashboard -> functions -> you might see a red exclamation mark next to your function that is causing the issue, delete it and redeploy.
-1

Set your directory to your project directory \functions then run this command: npm install -g firebase-tools