17

I'm using $firebase deploy to upload my static files to my newly created firebase project, but I get the following error in the command line.

Unable to authorize access to project project-1234567890

The error message goes on to mention the Firebase CLI is only compatible with the new Firebase Console, which is what I'm using.

I've signed in earlier, so I believe I should have access to the project I've created in the console.

Andrew Kelly
  • 2,180
  • 2
  • 19
  • 27

9 Answers9

45

Try running this after you go through your firebase init

firebase use --add

From there you can select your instance, for example: your-project-name-instance

I had the same issue, and running that command and selecting the instance allowed me to do the deploy.

Matt
  • 1,811
  • 1
  • 19
  • 30
  • Thanks, Matt. Worked out for me! – Un1 May 25 '16 at 13:25
  • Question, when I try to run that command after my init on my new project, the list of projects are not displayed, even the new one I have just created. Learning firebases has been a nightmare for me so far, when it shouldn't be, it all seems fairly straight forward. (I'd like to hear what you have to say before I create a question.) – Michael Barreiro May 30 '16 at 04:33
  • 1
    I'm assuming you're already authenticated within the terminal prompt? Meaning if you signed up with your gmail/google login, it asks you to authorize and then goes into the browser? You might have to run firebase login? – Matt May 30 '16 at 14:36
  • @Matt I tried ur solution but this is not working for me – Vino Sep 03 '17 at 04:22
  • @vino what happened? Was there an error? Did you authenticate first? – Matt Sep 04 '17 at 23:06
  • @Matt I have done firebase authentication, but still, I receive same error line in cmd as reported by Andrew – Vino Sep 05 '17 at 10:51
17

I solved my problem with the following steps:

  1. I removed .firebaserc.
  2. Then I again ran:

    firebase init
    
  3. Then I chose my default project.

Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207
İbrahim Dolapci
  • 283
  • 1
  • 3
  • 10
12

Type these commands:

  1. firebase login

    Login with your email that content your Firebase project

  2. `firebase use --add

    Choose the name of your project

  3. Now type: firebase deploy
John Cummings
  • 1,949
  • 3
  • 22
  • 38
12

You can check firebase-debug.log In my case, the error was "FirebaseError: HTTP Error: 401, Request had invalid authentication credentials."

run the following command:-

firebase login --reauth

then you can use

firebase deploy
Alok Kamboj
  • 1,017
  • 11
  • 12
4

When I tried doing a $firebase deploy --debug my upload seemed to work. I'm not sure if this new command arg fixed the issue, or if I needed to wait a certain amount of time after creating the project before performing the deploy.

Andrew Kelly
  • 2,180
  • 2
  • 19
  • 27
3

Make sure you are logged in into the right account. So use $firebase logout out and then $firebase login select the correct account and allow CLI.

2

Authorization issue requires you to permit the currently logged under "Project Overview --> Users and Permissions". This error means that the logged in user does not belong to any of the permitted roles for firebase database in question. You must go to firebase console and add user to a role under Users and Permissions.

Manoj Goel
  • 2,034
  • 4
  • 12
  • 24
1

I did yarn build

and add { "projects": { "default": "xxx", "staging": "yyyy" } }

to .firebaserc

not sure which one helped!

Mehrnoosh
  • 879
  • 2
  • 12
  • 27
0

I also facing this issue and fixed now.

  1. I also facing this issue and fixed now.
  2. I tried logout, logging but any firebase command showing this same error.
  3. I confirmed my user id have full access.
  4. I tried firebase cli update npm install -g firebase-tools not worked
  5. I run CMD as run as administrator it worked for some time. But no longer;

Finally, I fixed this issue by delete the .config folder then firebase command is working and new .config folder created

C:\Users\DELL\.config