firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Please run firebase login --reauth (when using FIREBASE_TOKEN)

Open heygambo opened this issue 9 years ago • 23 comments

I've removed and reinstalled firebase-tools using npm and yarn. For some reason even after running firebase login --reauth it will still complain about it.

⚠ Your CLI authentication needs to be updated to take advantage of new features. ⚠ Please run firebase login --reauth

versions: firebase-tools 3.9.0 node v7.2.1 nvm 0.33.0

Does anyone know how to get rid of this warning?

heygambo avatar May 22 '17 15:05 heygambo

yes, I'm seeing the same problem. Any resolution? (edit, this was because I used the project name, not the id).

justinbmeyer avatar Jun 14 '17 17:06 justinbmeyer

I'm still getting:

✔  Database Rules for abc have been downloaded to database.rules.json.
Future modifications to database.rules.json will update Database Rules when you run
firebase deploy.

=== Functions Setup

A functions directory will be created in your project with a Node.js
package pre-configured. Functions can be deployed with firebase deploy.


Error: This command requires new authorization scopes not granted to your current session. Please run firebase login --reauth

Running reauth doesn't help.

heygambo avatar Jul 12 '17 07:07 heygambo

After months I have finally found the issue.

I've had export FIREBASE_TOKEN=abc in my ~/.zshenv file and forgot about it.

Now everything works fine!

I wish there would have been a note that I'm using my FIREBASE_TOKEN or that this is something I should have looked for.

e.g.

⚠ Your CLI authentication needs to be updated to take advantage of new features. ⚠ Note that you're using the FIREBASE_TOKEN environment variable. ⚠ Please renew or remove that and try again.

heygambo avatar Jul 13 '17 07:07 heygambo

Another way that works for me to work around this issue is by logging out and re-login the Firebase CLI.

muhammadghazali avatar Aug 25 '17 23:08 muhammadghazali

Another way that works for me to work around this issue is by logging out and re-login the Firebase CLI.

This was my first guess as well. But if that doesn't work, then have a look at the terminal environment variables.

heygambo avatar Aug 25 '17 23:08 heygambo

I found what was the problem. Please follow steps below

Step 1 Create firebase project @ Firebase console Step 2 Login into firebase via cmd firebase login Step 3 Run firebase init Initialize app by selecting existing app you created in Step 1 Step 4 Run firebase deploy should deploy your application

mohanramphp avatar Sep 17 '17 12:09 mohanramphp

I found what was the problem. Please follow steps below Step 1 Create firebase project @ Firebase console Step 2 Login into firebase via cmd firebase login Step 3 Run firebase init Initialize app by selecting existing app you created in Step 1 Step 4 Run firebase deploy should deploy your application

This was my first guess as well. But if that doesn't work, then have a look at the terminal environment variables.

This ticket is still open because of my suggestion to add a note about old firebase tokens: https://github.com/firebase/firebase-tools/issues/342#issuecomment-314994814

heygambo avatar Sep 17 '17 12:09 heygambo

@nerdyglasses I face same issue and once i created project first in firebase console and then it worked. Can you brief what sequence or steps to reproduce your issue

mohanramphp avatar Sep 17 '17 12:09 mohanramphp

@mohanramphp put this in your .bashrc or .zshrc, then start a new terminal session: export FIREBASE_TOKEN=94th393g8h2g23g

and run firebase deploy.

heygambo avatar Sep 17 '17 12:09 heygambo

What works for me is to run firebase logout and then login with firebase login.

alltej avatar Oct 29 '17 09:10 alltej

@alltej did you have a FIREBASE_TOKEN from firebase 2 in your shell's environment? My point is that this will make the firebase 3 cli break.

heygambo avatar Oct 29 '17 12:10 heygambo

I got this error by passing a wrong project id to the -P flag.

Basically, I thought I could define projects in my firebaserc file like this:

{
  "projects": {
    "staging": "firebase-staging-project-id"
    "production": "firebase-production-project-id"
  }
}

And call

firebase deploy --token "$FIREBASE_TOKEN" -P staging

But it fails with the error described here.

While passing the full project id like below

firebase deploy --token "$FIREBASE_TOKEN" -P firebase-staging-project-id

works without problem. So maybe this P flag should need a more informative message ? Also, is this the expected behavior or a bug ?

Overdrivr avatar Mar 22 '18 09:03 Overdrivr

I had the same issue as @Overdrivr - passing the wrong project name raised the auth prompt and 500 error subsequently.

Passing an invalid project name should really be caught and have a more appropriate error message.

NikolaJankovic avatar Apr 10 '18 01:04 NikolaJankovic

I am getting this error without attempting to use a FIREBASE_TOKEN param.

have tried to `relogin,

--reauth,

creating and deploying another test project

upgrading all packages

and to delete and reinit firebase`

my firebase-debug.log looks like this

my npm debug.log looks like this

Any ideas?

mmorrison24 avatar May 10 '18 12:05 mmorrison24

@mmorrison24 make sure it's not in your export list in the terminal.

run export and see if there is a FIREBASE_TOKEN outputted.

heygambo avatar May 18 '18 09:05 heygambo

I ran export but there is no FIREBASE_TOKEN, still getting the error

philip-firstorder avatar Jun 02 '18 23:06 philip-firstorder

In my case am unable to evenlogin.
So CLI wont allow me to even initialize a project.
Looks like am trapped. firebase-cli

guruprasaad123 avatar Sep 28 '18 13:09 guruprasaad123

I see that the original error (regarding FIREBASE_TOKEN) was resolved. There's still some questions regarding warning when using the environment to authenticate, which is actually something that is currently being worked on internally (though, slowly). I'm closing this issue as there's not been recent activity on it. If anyone is still having issues with authentication, I'd ask that you open a new bug with the appropriate information! Thanks!

bkendall avatar Jan 09 '19 00:01 bkendall

In my case am unable to evenlogin. So CLI wont allow me to even initialize a project. Looks like am trapped. firebase-cli

i'm having the same problem please suggest a help

BuddhaNag12 avatar Jul 12 '19 16:07 BuddhaNag12

@BuddhaNag12 please open a new issue so we can better track this. Thank you.

bkendall avatar Jul 12 '19 16:07 bkendall