When I try to run `Firebase deploy', it stucks at this line of code
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
the firebase init and firebase login are doing fine but firebase deploy keeps stuck. My firebase version is 3.18.4 and im currently using ubuntu 17.10.
EDIT:
and after waiting for about an hour it diplays this line of code
FIREBASE WARNING: auth() was canceled: Auth token is expired.
Am I doing something wrong?. I am new to Firebase and I need some tips/ advice on why this happening
Here is a tip, that might help you. Give it a try and tell me if it resolves your issue.
Always use these commands instead of just firebase deploy
firebase deploy --only hosting
firebase deploy --only functions <<- use this in ur case. Also make sure your in the directory /functions of your project where you ran your firebase init
Sometimes Firebase services may be down, which would prevent you from deploying your code. If you can't deploy, check this site and see if at least all services are up and running: https://status.firebase.google.com/
Related
I have a weird problem with log in to Firebase using CLI. It's never happened before, so It's weird. I can log in using console.firebase.google.com, but not with CLI.
Because of that, I can't deploy updates to my service with firebase deploy --only hosting.
I tried to use: firebase login --reauth, remove .firebaserc, but with no success. The error message is always the same:
Firebase CLI Login Failed
The Firebase CLI login request was rejected or an error occurred. Please run a firebase login again or contact support if you continue to have difficulty logging in.
I thought that it's related to antivirus, because today I installed Bitdefender, and after that, I installed eset trial version. But I'm not sure it can be a problem, because I tried to stop eset - no success. Any idea?
When trying to deploy my Firebase Functions (after switching computers) I get an error and can't deploy.
Error: HTTP Error: 403, Service Usage API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/serviceusage.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
I do not have a project with that ID and have switched between projects and it always gives me the exact same project ID. That link doesn't work for me, but when I put my project ID instead of 563584335869 then it works and the Service Usage API is enable.
Logging out and back in didn't solve the issue, neither did a firebase init.
Anybody know what could be causing this?
I think it may be related to firebase-tools 7.1.0. I back to 7.0.2 and it worked fine.
sudo npm uninstall firebase-tools
sudo npm i -g firebase-tools#7.0.2
firebaser here
There was indeed an issue introduced in the deployment of Cloud Functions with Firebase CLI version 7.1.0. The issue has now been fixed on our backend servers, and you should no longer encounter this issue.
If you continue to have problems, reach out to Firebase support for personalized help in troubleshooting.
I was getting the project 563584335869 error with Cloud Functions in the Firebase Emulators but not with Cloud Functions in the Firebase Cloud. In the Cloud I was getting a more common error about lack of credentials. I fixed both by adding Firebase Admin to the IAM service account for my Cloud Functions.
so, im a newbie in programming and still learning some stuff (i use windows btw)
i try to make an app, connect it to firebase.
after setting up everything its time to setting the CLI
good news : i successfully setting up everything from node to nvm untill sucessfully launch the login in CLI.
bad news : right after successfully logn the CLI, im trying to type in the cmd
firebase deploy --only function
and this error appear
Error: not in a Firebase app directory (could not locate firebase.json)
i already search the web for the solution but i found nothing
can someone tell me did i miss something ?
thanks.
After logging into firebase with "firebase login" you will need to do: "firebase init" and then select the correct options when prompted. be sure to press the space bar to check the functions circle in the command line.
firebase init didn't work for me, but firebase init hosting did. You can read the firebase hosting initialization docs here.
firebase init
or
firebase init hosting
And then popup question:
Set up automatic builds and deploys with GitHub? No
I seem to be having issues getting my site live onto the Firebase Hosting.
I followed this tutorial: https://github.com/firebase/functions-samples/tree/master/stripe
Which has these steps:
Create a Firebase Project using the Firebase Developer Console
Enable billing on your project by switching to the Blaze or Flame plan. See pricing for more details. This is required to be able to do requests to non-Google services.
Enable Google sign on your Firebase project
Install Firebase CLI Tools if you have not already and log in with firebase login.
RESULT: Already logged in as user#gmail.com
Configure this sample to use your project using firebase use --add and select your project.
RESULT: Error: Firebase use must be run from a Firebase Directory
Run firebase init to start a project
Run firebase init
What Firebase CLI features do you want to setup for this directory?
Database
Functions
Hosting
I chose HOSTING.
Select a default Firebase project for this directory
I Chose the only project there and got:
✔ Firebase initialization complete
I Ran Firebase use --add again, chose and alias and not it says:
Now using alias stageTemp.
Install dependencies locally by running: cd functions; npm install; cd -
npm WARN stripe-functions# No repository field
npm WARN stripe-functions# No license field.
Add your Stripe API Secret Key to firebase config: firebase functions:config:set stripe.token=<YOUR STRIPE API KEY>
Optional: change your default currency firebase functions:config:set stripe.currency=GBP
Pass your Stripe publishable key to the Stripe.setPublishableKey call in public/index.html
Deploy your project using firebase deploy
When I run Firebase Deploy I get
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 (2.91 KB) for uploading
✔ functions: functions folder uploaded successfully
i starting release process (may take several minutes)...
i functions: updating function createStripeCharge...
i functions: updating function createStripeCustomer...
i functions: updating function addPaymentSource...
i functions: updating function cleanupUser...
✔ functions[createStripeCharge]: Successful update operation.
✔ functions[createStripeCustomer]: Successful update operation.
✔ functions[addPaymentSource]: Successful update operation.
✔ functions[cleanupUser]: Successful update operation.
✔ functions: all functions deployed successfully!
✔ Deploy complete!
Finally:
Test your Stripe integration by viewing your deployed site firebase open hosting:site
and then I get this:
Can anyone see why this is not working? I have gone through these steps several times and cannot seem to get it to work.
Much appreciated.
Questions for Firebase Devs:
1) This code on the example has: amount: parseInt(). What checks are in place to make sure that the DOM is not simply edited by the user?
2) This process saves a lot of data. Is Firebase PCI Compliant so that I am legally allowed to store this data?
3) I'm confused about the process flow of functions. Is there an editable file that is run on the cloud where I can add extra information and database interactions or email sending? - I ask this because I want to insert into the database only when payment is verified. If I code it from the front end then a user could just run that in the console or wherever and insert into my db as it will have write access. (I hope this makes sense - I basically just want my function to be able to access the database and not anyone else)
Thank you for your time, I understand that you will be terrible busy and I really appreciate your help with this.
I recently submittet a "firebase deploy" command, and was notified that my deploy attempt had failed, due to insufficient authentication scope. What does "insufficient authentication scopes", mean?
I had a similar issue and I contacted the support who told me they are working on it.
They also provided a workaround that worked for me. Instead of calling firebase deploy to update everything, split the process and call:
firebase deploy --only hosting
firebase deploy --only database
For hosting, an other workaround is to deploy twice (the update actually works, only the 'Current' version is not updated to the latest), and then rollback the latest deploy, which will make the previous (identical) one current.