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.
Related
I've deployed hundreds of function and this is the first time I encounter this issue. Simply, it stops deploying function process, saying:
Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/[project-name]/us/gcf
The way I deploy is through Firebase CLI command: firebase deploy --only functions:nameOfFunction
Question is what are those images I have to delete? Why? How can I solve it?
Cloud Functions uses another product called Cloud Build to build the server images that actually get deployed. Those images are stored in Cloud Storage, and that storage is billed to your account.
Read more about it:
https://github.com/firebase/firebase-tools/issues/3404
https://krasimirtsonev.com/blog/article/firebase-gcp-saving-money
Watch:
https://www.youtube.com/watch?v=aHaI0jZ5rwM
You should be able to locate and delete the files manually in the Google Cloud console. But it sounds like there is a bug here with the files not being cleaned up automatically, so you contact Firebase support directly.
For me the issue appeared to be related to my GCF billing (https://console.cloud.google.com/billing)
I had to go to my billing account to see that my payment method was expired or something, and GCF had forecasted a monthly cost of $0.01, so deploying cloud functions was sort of locked until I updated the payment method. Then the deploy immediately worked again after updating it. The build-cleanup console warning also disappeared.
The error I was seeing in my function logs in firebase console was "billing account is not available". Which I found almost zero results for in Google. Which is why I'm posting it here.
For me, the issue was caused by a silly typo.
The error:
Functions deploy had errors with the following functions:
sendNotification(europe-west) i functions: cleaning up build files... ⚠ functions: Unhandled error cleaning up build images. This
could result in a small monthly bill if not corrected. You can attempt
to delete these images by redeploying or you can delete them manually
at...
The fix was choosing the right region.
The incorrect region:
exports.sendNotification = functions
.region("europe-west")...
The correct region:
exports.sendNotification = functions
.region("europe-west3")...
Go to https://console.cloud.google.com/apis/api/artifactregistry.googleapis.com/overview
select your project
enable Artifact Registry API
deploy functions again
In my experience going into Cloud Storage didn't solve the issue: there was no image there to be deleted.
I solved by changing the Node version, moving from 18 to 14.0.0
nvm install 14.0.0
nvm use 14.0.0
Check your Function logs, by either navigating through functions in the Firebase console or through https://console.cloud.google.com/logs
For me, the logs indicated that one of my typescript files had compiled under the wrong name and it was messing up the build.
Check the logs!
General troubleshooting tips given the variety of answers here:
if build is failing, read for other errors further up in the build output
add --debug to your CLI call, i.e.:
firebase deploy --only functions --debug
With --debug I found this in my output: "Permission 'artifactregistry.packages.delete' denied on resource"
My solution was to add Artifact Registry Administrator role to the IAM user deploying the function (in addition to Firebase Admin & Service Account User roles).
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
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/