Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase CLI deploy functions - Error: Failed to initialize a region

I'm having trouble doing firebase deploy --only functions for an app on Blaze plan. I have the latest firebase-tools CLI (v 3.5.0).

I get the following error:

=== Deploying to 'myapp1234'...

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
i  runtimeconfig: ensuring necessary APIs are enabled...
✔  runtimeconfig: all necessary APIs are enabled
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (1.29 KB) for uploading
✔  functions: functions folder uploaded successfully
i  starting release process (may take several minutes)...
i  functions: updating function myFunc...
⚠  functions[myFunc]: Deploy Error: Failed to initialize a region


Functions deploy had errors. To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.

I've retried this every half hour for the past 12 hours, thinking there's an outage. The firebase status page shows all green.

like image 461
Radu Cugut Avatar asked Mar 29 '17 10:03

Radu Cugut


People also ask

What is firebase CLI?

The Firebase CLI is a utility used to administer Firebase projects and perform tasks such as Realtime Database management tasks from the command-line of a terminal or command-prompt window. The Firebase CLI is also the method by which Firebase Cloud Functions are deployed and managed.


1 Answers

Ok, here's what I found, a little weird:

firebase list shows all the firebase projects you have access to, BUT they are not already available (i.e. added as alias to your current folder project).

Even if the firebase-tools CLI allows you to do firebase deploy --project myproject1, if you do not have myproject1 declared in .firebaserc => it will fail with the weird region error above.

To fix this, I found that there are 2 options:

  • firebase use --add (will trigger an interactive list)
  • firebase use myproject1

=> and then firebase deploy --project myproject1 will work (with or without the optional --only functions)

like image 97
Radu Cugut Avatar answered Oct 04 '22 21:10

Radu Cugut